mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-11 06:04:33 +00:00
NoEvo Redo
This commit is contained in:
parent
b84ddd8859
commit
facba6d9cd
36 changed files with 6686 additions and 2425 deletions
|
|
@ -448,6 +448,23 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
%client = %player.client;
|
||||
%player.holdingFlag = %flag; //%player has this flag
|
||||
%flag.carrier = %player; //this %flag is carried by %player
|
||||
|
||||
// attach the camera to the flag.carrier
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if(%cl.team <= 0 && %cl.observingFlag && %cl.flagObsTeam == %flag.team)
|
||||
observeFlag(%cl, %player.client, 2, %flag.team);
|
||||
}
|
||||
%player.mountImage(FlagImage, $FlagSlot, true, %game.getTeamSkin(%flag.team));
|
||||
%game.playerGotFlagTarget(%player);
|
||||
|
||||
//only cancel the return timer if the player is in bounds...
|
||||
if(!%client.outOfBounds)
|
||||
{
|
||||
cancel($FlagReturnTimer[%flag]);
|
||||
$FlagReturnTimer[%flag] = "";
|
||||
}
|
||||
|
||||
%player.mountImage(FlagImage, $FlagSlot, true, %game.getTeamSkin(%flag.team));
|
||||
|
||||
|
|
@ -473,7 +490,32 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
|
||||
if (%startStalemate)
|
||||
%game.stalemateSchedule = %game.schedule(%game.stalemateTimeMS, beginStalemate);
|
||||
|
||||
if($Host::ClassicEvoStats && !$Host::TournamentMode)
|
||||
{
|
||||
$stats::grabs[%client]++;
|
||||
if($stats::grabs[%client] > $stats::grabs_counter)
|
||||
{
|
||||
$stats::grabs_counter = $stats::grabs[%client];
|
||||
$stats::grabs_client = getTaggedString(%client.name);
|
||||
}
|
||||
}
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
%game.totalFlagHeldTime[%flag] = getSimTime();
|
||||
}
|
||||
|
||||
if($Host::ClassicEvoStats && !%player.flagStatsWait && !$Host::TournamentMode)
|
||||
{
|
||||
%grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6);
|
||||
|
||||
if(%grabspeed > $stats::MaxGrabSpeed || ($stats::MaxGrabSpeed $= ""))
|
||||
{
|
||||
$stats::MaxGrabSpeed = %grabspeed;
|
||||
$stats::Grabber = getTaggedString(%client.name);
|
||||
}
|
||||
}
|
||||
|
||||
%flag.hide(true);
|
||||
%flag.startFade(0, 0, false);
|
||||
%flag.isHome = false;
|
||||
|
|
@ -486,7 +528,7 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
messageTeam(%flag.team, 'MsgCTFFlagTaken', '\c2Your flag has been taken by %1!~wfx/misc/flag_taken.wav',%client.name, 0, %flag.team, %client.nameBase);
|
||||
messageTeam(0, 'MsgCTFFlagTaken', '\c2%1 took the %2 flag.~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase);
|
||||
messageClient(%client, 'MsgCTFFlagTaken', '\c2You took the %2 flag.~wfx/misc/flag_snatch.wav', %client.name, %teamName, %flag.team, %client.nameBase);
|
||||
logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") took team "@%flag.team@" flag");
|
||||
logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") took team "@%flag.team@" flag ("@%grabspeed@")"); // MP: 6/15/2011 added grabspeed.
|
||||
|
||||
//call the AI function
|
||||
%game.AIplayerTouchEnemyFlag(%player, %flag);
|
||||
|
|
@ -531,13 +573,23 @@ function CTFGame::playerDroppedFlag(%game, %player)
|
|||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag?
|
||||
|
||||
%game.playerLostFlagTarget(%player);
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
%game.totalFlagHeldTime[%flag] = 0;
|
||||
|
||||
%player.holdingFlag = ""; //player isn't holding a flag anymore
|
||||
%flag.carrier = ""; //flag isn't held anymore
|
||||
$flagStatus[%flag.team] = "<In the Field>";
|
||||
|
||||
// attach the camera again to the flag
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if(%cl.team <= 0 && %cl.observingFlag && %cl.flagObsTeam == %flag.team)
|
||||
observeFlag(%cl, $TeamFlag[%flag.team], 1, %flag.team);
|
||||
}
|
||||
%player.unMountImage($FlagSlot);
|
||||
%flag.hide(false); //Does the throwItem function handle this?
|
||||
%flag.hide(false); //Does the throwItem function handle this?
|
||||
|
||||
%teamName = %game.getTeamName(%flag.team);
|
||||
messageTeamExcept(%client, 'MsgCTFFlagDropped', '\c2Teammate %1 dropped the %2 flag. (Held: %4)~wfx/misc/flag_drop.wav', %client.name, %teamName, %flag.team, %held); // z0dd - ZOD, 8/15/02. How long flag was held
|
||||
|
|
@ -563,8 +615,74 @@ function CTFGame::flagCap(%game, %player)
|
|||
%flag.carrier = "";
|
||||
|
||||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag?
|
||||
|
||||
|
||||
%game.playerLostFlagTarget(%player);
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
{
|
||||
%held2 = getSimTime() - %game.totalFlagHeldTime[%flag];
|
||||
%realtime = %game.formatTime(%held2, true);
|
||||
%record = false;
|
||||
if(%game.totalFlagHeldTime[%flag])
|
||||
{
|
||||
if(%client.team == 1)
|
||||
{
|
||||
if((%held2 < $flagstats::heldTeam1) || $flagstats::heldTeam1 == 0)
|
||||
{
|
||||
if($HostGamePlayerCount >= $Host::MinFlagRecordPlayerCount)
|
||||
{
|
||||
$flagstats::heldTeam1 = %held2;
|
||||
$flagstats::realTeam1 = %realTime;
|
||||
$flagstats::nickTeam1 = %client.nameBase;
|
||||
}
|
||||
%record = true;
|
||||
}
|
||||
}
|
||||
else if(%client.team == 2)
|
||||
{
|
||||
if((%held2 < $flagstats::heldTeam2) || $flagstats::heldTeam2 == 0)
|
||||
{
|
||||
if($HostGamePlayerCount >= $Host::MinFlagRecordPlayerCount)
|
||||
{
|
||||
$flagstats::heldTeam2 = %held2;
|
||||
$flagstats::realTeam2 = %realTime;
|
||||
$flagstats::nickTeam2 = %client.nameBase;
|
||||
}
|
||||
%record = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(%record == true)
|
||||
{
|
||||
if($HostGamePlayerCount >= $Host::MinFlagRecordPlayerCount)
|
||||
{
|
||||
%fileOut = "stats/maps/classic/" @ $CurrentMissionType @ "/" @ $CurrentMission @ ".txt";
|
||||
export("$flagstats::*", %fileOut, false);
|
||||
schedule(4000, 0, "messageAll", 'MsgCTFNewRecord', "\c2It's a new record! Time: \c3"@%realtime@"\c2.~wfx/misc/hunters_horde.wav");
|
||||
}
|
||||
else
|
||||
schedule(4000, 0, "messageClient", %client, '', "\c2Minimum of" SPC $Host::MinFlagRecordPlayerCount SPC "Players to set a new flag record.");
|
||||
}
|
||||
}
|
||||
|
||||
if(!$Host::TournamentMode)
|
||||
bottomprint(%client, "You captured the flag in " @ %realTime @ " seconds", 3);
|
||||
|
||||
$stats::caps[%client]++;
|
||||
if($stats::caps[%client] > $stats::caps_counter)
|
||||
{
|
||||
$stats::caps_counter = $stats::caps[%client];
|
||||
$stats::caps_client = getTaggedString(%client.name);
|
||||
}
|
||||
|
||||
if(%held2 < $stats::fastestCap || !$stats::fastestCap)
|
||||
{
|
||||
$stats::fastestCap = %held2;
|
||||
$stats::fastcap_time = %realTime;
|
||||
$stats::fastcap_client = getTaggedString(%client.name);
|
||||
}
|
||||
}
|
||||
|
||||
//award points to player and team
|
||||
%teamName = %game.getTeamName(%flag.team);
|
||||
messageTeamExcept(%client, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held);
|
||||
|
|
@ -572,7 +690,7 @@ function CTFGame::flagCap(%game, %player)
|
|||
messageTeam(0, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held);
|
||||
messageClient(%client, 'MsgCTFFlagCapped', '\c2You captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held); // Yogi, 8/18/02. 3rd param changed 0 -> %client.name
|
||||
|
||||
logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") capped team "@%client.team@" flag"@" (Held: "@%held@")");
|
||||
logEcho(%client.nameBase@" (pl "@%player@"/cl "@%client@") capped team "@%client.team@" flag"@" (Held: "@%held@")"); // MP: 6/14/2011 The team is wrong, but the stats program auto-corrects it, so just leave as is
|
||||
%player.holdingFlag = ""; //no longer holding it.
|
||||
%player.unMountImage($FlagSlot);
|
||||
%game.awardScoreFlagCap(%client, %flag);
|
||||
|
|
@ -581,21 +699,42 @@ function CTFGame::flagCap(%game, %player)
|
|||
//call the AI function
|
||||
%game.AIflagCap(%player, %flag);
|
||||
|
||||
//if this cap didn't end the game, play the announcer...
|
||||
if ($missionRunning)
|
||||
//Determine score status
|
||||
%caplimit = MissionGroup.CTF_scoreLimit;
|
||||
%otherteam = ( %client.team == 1 ) ? 2 : 1;
|
||||
//Find out caps from score
|
||||
%clientteamcaps = mFloor($TeamScore[%client.team] / %game.SCORE_PER_TEAM_FLAG_CAP);
|
||||
%otherteamcaps = mFloor($TeamScore[%otherteam] / %game.SCORE_PER_TEAM_FLAG_CAP);
|
||||
|
||||
//Determine Gamepoint
|
||||
if(%clientteamcaps >= (%caplimit - 1))
|
||||
{
|
||||
if (%game.getTeamName(%client.team) $= 'Inferno')
|
||||
messageAll("", '~wvoice/announcer/ann.infscores.wav');
|
||||
else if (%game.getTeamName(%client.team) $= 'Storm')
|
||||
messageAll("", '~wvoice/announcer/ann.stoscores.wav');
|
||||
else if (%game.getTeamName(%client.team) $= 'Phoenix')
|
||||
messageAll("", '~wvoice/announcer/ann.pxscore.wav');
|
||||
else if (%game.getTeamName(%client.team) $= 'Blood Eagle')
|
||||
messageAll("", '~wvoice/announcer/ann.bescore.wav');
|
||||
else if (%game.getTeamName(%client.team) $= 'Diamond Sword')
|
||||
messageAll("", '~wvoice/announcer/ann.dsscore.wav');
|
||||
else if (%game.getTeamName(%client.team) $= 'Starwolf')
|
||||
messageAll("", '~wvoice/announcer/ann.swscore.wav');
|
||||
if(%clientteamcaps == %otherteamcaps)
|
||||
%scorestatus = "tied";
|
||||
else
|
||||
%scorestatus = "gamepoint";
|
||||
}
|
||||
else
|
||||
%scorestatus = "normal";
|
||||
|
||||
//if this cap didn't end the game, play the announcer...
|
||||
if($missionRunning)
|
||||
{
|
||||
switch$(%scorestatus)
|
||||
{
|
||||
case normal:
|
||||
//classic uses only storm/inferno
|
||||
if(%game.getTeamName(%client.team) $= 'Inferno')
|
||||
messageAll("", '~wvoice/announcer/ann.infscores.wav');
|
||||
else if(%game.getTeamName(%client.team) $= 'Storm')
|
||||
messageAll("", '~wvoice/announcer/ann.stoscores.wav');
|
||||
case tied:
|
||||
//Announce tied message
|
||||
messageAll("", '~wvoice/announcer/ann.closegame_03.wav');
|
||||
case gamepoint:
|
||||
//Announce gamepoint
|
||||
messageAll("", '~wvoice/announcer/ann.gamepoint_imminent.wav');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -619,6 +758,23 @@ function CTFGame::flagReturn(%game, %flag, %player)
|
|||
else
|
||||
%otherTeam = 1;
|
||||
%teamName = %game.getTeamName(%flag.team);
|
||||
|
||||
// when the flag return, stop observing the flag, and go in observerFly mode
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if(%cl.team <= 0 && %cl.observingFlag && %cl.flagObsTeam == %flag.team)
|
||||
{
|
||||
%cl.camera.mode = "observerFly";
|
||||
%cl.camera.setFlyMode();
|
||||
updateObserverFlyHud(%cl);
|
||||
|
||||
%cl.observingFlag = false;
|
||||
%cl.flagObserved = "";
|
||||
%cl.flagObsTeam = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (%player !$= "")
|
||||
{
|
||||
//a player returned it
|
||||
|
|
@ -710,8 +866,9 @@ function CTFGame::beginStalemate(%game)
|
|||
// z0dd - ZOD, 5/27/03. Added anti-turtling, return flags after x minutes
|
||||
if(!$Host::TournamentMode)
|
||||
{
|
||||
messageAll( 'MsgStalemate', '\c3Anti turtle initialized. Flags will be returned to bases in %1 minutes.', $Host::ClassicAntiTurtleTime);
|
||||
%game.turtleSchedule = %game.schedule($Host::ClassicAntiTurtleTime * 60000, 'antiTurtle');
|
||||
messageAll( 'MsgStalemate', "\c3Anti turtle initialized. Flags will be returned to bases in " @ $Host::ClassicAntiTurtleTime @ " minutes.");
|
||||
%game.turtleSchedule = %game.schedule($Host::ClassicAntiTurtleTime * 60000, "antiTurtle");
|
||||
error(formatTimeString("HH:nn:ss") SPC "Anti-Turtle thread beginning now - ID:" SPC %game.turtleSchedule);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -720,19 +877,28 @@ function CTFGame::endStalemate(%game)
|
|||
%game.stalemate = false;
|
||||
%game.hideStalemateTargets();
|
||||
cancel(%game.stalemateSchedule);
|
||||
cancel(%game.turtleSchedule);
|
||||
}
|
||||
|
||||
// z0dd - ZOD, 5/27/03. Anti-turtle function
|
||||
function CTFGame::antiTurtle(%game)
|
||||
{
|
||||
if(isEventPending(%game.turtleSchedule))
|
||||
cancel(%game.turtleSchedule);
|
||||
cancel(%game.turtleSchedule);
|
||||
|
||||
for (%i = 1; %i <= 2; %i++)
|
||||
{
|
||||
if(%game.turtleSchedule > 0)
|
||||
%game.turtleSchedule = 0;
|
||||
|
||||
if(isEventPending(%game.stalemateSchedule))
|
||||
cancel(%game.stalemateSchedule);
|
||||
|
||||
if(%game.stalemateSchedule > 0)
|
||||
%game.stalemateSchedule = 0;
|
||||
|
||||
for (%i = 1; %i <= Game.numTeams; %i++)
|
||||
Game.flagReturn($TeamFlag[%i]);
|
||||
messageAll( 'MsgCTFFlagReturned', '\c3Both flags returned to bases to break stalemate.~wfx/misc/flag_return.wav', 0, 0, %i);
|
||||
}
|
||||
|
||||
messageAll( "", "\c3Both flags returned to bases to break stalemate.~wfx/misc/flag_return.wav");
|
||||
error(formatTimeString("HH:nn:ss") SPC "Anti-Turtle thread ended");
|
||||
}
|
||||
|
||||
function CTFGame::flagReset(%game, %flag)
|
||||
|
|
@ -740,7 +906,7 @@ function CTFGame::flagReset(%game, %flag)
|
|||
cancel(%game.updateFlagThread[%flag]); // z0dd - ZOD, 8/4/02. Cancel this flag's thread to KineticPoet's flag updater
|
||||
|
||||
//any time a flag is reset, kill the stalemate schedule
|
||||
%game.endStalemate();
|
||||
%game.endStalemate(%game);
|
||||
|
||||
//make sure if there's a player carrying it (probably one out of bounds...), it is stripped first
|
||||
if (isObject(%flag.carrier))
|
||||
|
|
@ -1623,6 +1789,9 @@ function CTFGame::boundaryLoseFlag(%game, %player)
|
|||
%flag.setCollisionTimeout(%player);
|
||||
|
||||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag?
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
%game.totalFlagHeldTime[%flag] = 0;
|
||||
|
||||
%game.playerDroppedFlag(%player);
|
||||
|
||||
|
|
|
|||
2181
Classic/scripts/GameGui.cs
Normal file
2181
Classic/scripts/GameGui.cs
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,5 +1,5 @@
|
|||
//-------------------------------------------------------------------
|
||||
// Team Rabbit script
|
||||
// Lak Rabbit script
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// DisplayName = LakRabbit
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
//
|
||||
// v3.36 Dec 2019
|
||||
// Boundary bounce speed limit
|
||||
// Unified Lakrabbit Vars
|
||||
//
|
||||
// v3.35 April 2019
|
||||
// Added Not enough players flag message delay
|
||||
|
|
@ -124,7 +125,7 @@
|
|||
// v1 - See game rules.
|
||||
|
||||
// Vars:
|
||||
// $Host::ShowFlagIcon
|
||||
// $Host::LakRabbitShowFlagIcon
|
||||
// 0 - Don't show any
|
||||
// 1 - Show flag icon when flag dropped only
|
||||
// 2 - Show flag icon on rabbit
|
||||
|
|
@ -138,14 +139,14 @@
|
|||
// 1 - Enable Duel Mode
|
||||
//
|
||||
// $Host::LakRabbitNoSplashDamage
|
||||
// 0 - Disable No Splash Dame
|
||||
// 0 - Disable No Splash Damage
|
||||
// 1 - Enable No Splash Damage
|
||||
//
|
||||
// $Host::ShowFlagTask
|
||||
// $Host::LakRabbitShowFlagTask
|
||||
// 0 - Do not show flag task
|
||||
// 1 - Show the flag when dropped as a task
|
||||
//
|
||||
// $Host::EnableLakUnlimitedDJ
|
||||
// $Host::LakRabbitUnlimitedDJ
|
||||
// 0 - Players only get one DiscJump
|
||||
// 1 - Players get 999 or unlimited DiscJumps
|
||||
//
|
||||
|
|
@ -162,7 +163,7 @@ function Flag::objectiveInit(%data, %flag)
|
|||
%flag.rotate = true;
|
||||
|
||||
// ilys -- add the icon to the flag
|
||||
if( $Host::ShowFlagIcon == 1 || $Host::ShowFlagIcon == 2 )
|
||||
if( $Host::LakRabbitShowFlagIcon == 1 || $Host::LakRabbitShowFlagIcon == 2 )
|
||||
{
|
||||
%flag.scopeWhenSensorVisible(true);
|
||||
setTargetSensorGroup(%flag.getTarget(), $NonRabbitTeam);
|
||||
|
|
@ -171,7 +172,7 @@ function Flag::objectiveInit(%data, %flag)
|
|||
}
|
||||
|
||||
// create a waypoint to the flag's starting place
|
||||
if( $Host::ShowFlagIcon == 0 )
|
||||
if( $Host::LakRabbitShowFlagIcon == 0 )
|
||||
{
|
||||
%flagWaypoint = new WayPoint()
|
||||
{
|
||||
|
|
@ -1468,7 +1469,7 @@ function LakRabbitGame::playerSpawned(%game, %player)
|
|||
|
||||
//now set a waypoint just for that client...
|
||||
// ilys -- show client waypoint if not showing flag icon
|
||||
if($Host::ShowFlagIcon == 0 && $Host::ShowFlagTask)
|
||||
if($Host::LakRabbitShowFlagIcon == 0 && $Host::LakRabbitShowFlagTask)
|
||||
{
|
||||
cancel(%player.client.waypointSchedule);
|
||||
if (isObject(%clRabbit) && !%player.client.isAIControlled())
|
||||
|
|
@ -1498,7 +1499,7 @@ function LakRabbitGame::playerSpawned(%game, %player)
|
|||
%player.schedule(250,"selectWeaponSlot", 0);
|
||||
%player.setEnergyLevel(%player.getDatablock().maxEnergy);
|
||||
|
||||
if($Host::EnableLakUnlimitedDJ == 1)
|
||||
if($Host::LakRabbitUnlimitedDJ == 1)
|
||||
%player.freeDJ = 999; // free diskjump
|
||||
else
|
||||
%player.freeDJ = 1; // free diskjump
|
||||
|
|
@ -1655,7 +1656,7 @@ function LakRabbitGame::playerDroppedFlag(%game, %player)
|
|||
%player.unmountImage($FlagSlot);
|
||||
%flag.hide(false);
|
||||
// ilys -- remove flag icon from player
|
||||
if($Host::ShowFlagIcon == 1 || $Host::ShowFlagIcon == 2)
|
||||
if($Host::LakRabbitShowFlagIcon == 1 || $Host::LakRabbitShowFlagIcon == 2)
|
||||
{
|
||||
setTargetSensorGroup(%flag.getTarget(), $Observer);
|
||||
%player.scopeWhenSensorVisible(true);
|
||||
|
|
@ -1665,9 +1666,9 @@ function LakRabbitGame::playerDroppedFlag(%game, %player)
|
|||
}
|
||||
|
||||
//just always true
|
||||
//if( $Host::ShowFlagIcon == 1 )
|
||||
//if( $Host::LakRabbitShowFlagIcon == 1 )
|
||||
//%flag.scopeWhenSensorVisible(true);
|
||||
//else if($Host::ShowFlagIcon == 2)
|
||||
//else if($Host::LakRabbitShowFlagIcon == 2)
|
||||
//%flag.scopeWhenSensorVisible(false);
|
||||
|
||||
// borlak -- throw the flag, don't just drop it like dead weight
|
||||
|
|
@ -1691,7 +1692,7 @@ function LakRabbitGame::playerDroppedFlag(%game, %player)
|
|||
%flag.setCollisionTimeout(%player);
|
||||
|
||||
// ilys -- hide waypoint if not showing flag icon
|
||||
if($Host::ShowFlagIcon == 0 && $Host::ShowFlagTask)
|
||||
if($Host::LakRabbitShowFlagIcon == 0 && $Host::LakRabbitShowFlagTask)
|
||||
{
|
||||
cancel(%game.waypointSchedule);
|
||||
%game.hideRabbitWaypoint(%player.client);
|
||||
|
|
@ -1828,7 +1829,7 @@ function LakRabbitGame::playerTouchFlag(%game, %player, %flag)
|
|||
cancel(%flag.returnThread);
|
||||
%flag.hide(true);
|
||||
// ilys -- add flag icon to player
|
||||
if( $Host::ShowFlagIcon == 2 )
|
||||
if( $Host::LakRabbitShowFlagIcon == 2 )
|
||||
{
|
||||
setTargetSensorGroup(%flag.getTarget(), $RabbitTeam);
|
||||
%player.scopeWhenSensorVisible(true);
|
||||
|
|
@ -1869,7 +1870,7 @@ function LakRabbitGame::playerTouchFlag(%game, %player, %flag)
|
|||
//show the rabbit waypoint
|
||||
%game.rabbitDamageTime = 0;
|
||||
// ilys -- waypoint if not showing flag icon
|
||||
if($Host::ShowFlagIcon == 0 && $Host::ShowFlagTask)
|
||||
if($Host::LakRabbitShowFlagIcon == 0 && $Host::LakRabbitShowFlagTask)
|
||||
{
|
||||
cancel(%game.waypointSchedule);
|
||||
%game.showRabbitWaypoint(%player.client);
|
||||
|
|
@ -1922,7 +1923,7 @@ function LakRabbitGame::resetFlag(%game, %flag)
|
|||
%flag.hide(false);
|
||||
|
||||
//so flag turns back green
|
||||
if($Host::ShowFlagIcon == 1 || $Host::ShowFlagIcon == 2)
|
||||
if($Host::LakRabbitShowFlagIcon == 1 || $Host::LakRabbitShowFlagIcon == 2)
|
||||
{
|
||||
setTargetSensorGroup(%flag.getTarget(), $NonRabbitTeam);
|
||||
}
|
||||
|
|
@ -1978,13 +1979,13 @@ function LakRabbitGame::gameOver(%game)
|
|||
%client = ClientGroup.getObject(%i);
|
||||
%game.resetScore(%client);
|
||||
// ilys -- cancel waypoint if not showing flag icon
|
||||
if($Host::ShowFlagIcon == 0 && $Host::ShowFlagTask)
|
||||
if($Host::LakRabbitShowFlagIcon == 0 && $Host::LakRabbitShowFlagTask)
|
||||
cancel(%client.waypointSchedule);
|
||||
cancel(%client.duelTimer);
|
||||
}
|
||||
|
||||
// ilys -- cancel waypoint if not showing flag icon
|
||||
if($Host::ShowFlagIcon == 0 && $Host::ShowFlagTask)
|
||||
if($Host::LakRabbitShowFlagIcon == 0 && $Host::LakRabbitShowFlagTask)
|
||||
cancel(%game.waypointSchedule);
|
||||
|
||||
// borlak -- delete variables
|
||||
|
|
|
|||
|
|
@ -750,9 +750,16 @@ function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
%player.holdingFlag = %flag; //%player has this flag
|
||||
%flag.carrier = %player; //this %flag is carried by %player
|
||||
|
||||
// attach the camera to the flag.carrier
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if(%cl.team <= 0 && %cl.observingFlag && %cl.flagObsTeam == %flag.team)
|
||||
observeFlag(%cl, %player.client, 2, %flag.team);
|
||||
}
|
||||
%player.mountImage(FlagImage, $FlagSlot, true, %game.getTeamSkin(%flag.team));
|
||||
|
||||
%game.playerGotFlagTarget(%player);
|
||||
|
||||
//only cancel the return timer if the player is in bounds...
|
||||
if (!%client.outOfBounds)
|
||||
{
|
||||
|
|
@ -774,8 +781,32 @@ function SCtFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
|
||||
if (%startStalemate)
|
||||
%game.stalemateSchedule = %game.schedule(%game.stalemateTimeMS, beginStalemate);
|
||||
|
||||
|
||||
if($Host::ClassicEvoStats && !$Host::TournamentMode)
|
||||
{
|
||||
$stats::grabs[%client]++;
|
||||
if($stats::grabs[%client] > $stats::grabs_counter)
|
||||
{
|
||||
$stats::grabs_counter = $stats::grabs[%client];
|
||||
$stats::grabs_client = getTaggedString(%client.name);
|
||||
}
|
||||
}
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
%game.totalFlagHeldTime[%flag] = getSimTime();
|
||||
}
|
||||
|
||||
if($Host::ClassicEvoStats && !%player.flagStatsWait && !$Host::TournamentMode)
|
||||
{
|
||||
%grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6);
|
||||
|
||||
if(%grabspeed > $stats::MaxGrabSpeed || ($stats::MaxGrabSpeed $= ""))
|
||||
{
|
||||
$stats::MaxGrabSpeed = %grabspeed;
|
||||
$stats::Grabber = getTaggedString(%client.name);
|
||||
}
|
||||
}
|
||||
|
||||
%flag.hide(true);
|
||||
%flag.startFade(0, 0, false);
|
||||
%flag.isHome = false;
|
||||
|
|
@ -832,13 +863,23 @@ function SCtFGame::playerDroppedFlag(%game, %player)
|
|||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag?
|
||||
|
||||
%game.playerLostFlagTarget(%player);
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
%game.totalFlagHeldTime[%flag] = 0;
|
||||
|
||||
%player.holdingFlag = ""; //player isn't holding a flag anymore
|
||||
%flag.carrier = ""; //flag isn't held anymore
|
||||
$flagStatus[%flag.team] = "<In the Field>";
|
||||
|
||||
// attach the camera again to the flag
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if(%cl.team <= 0 && %cl.observingFlag && %cl.flagObsTeam == %flag.team)
|
||||
observeFlag(%cl, $TeamFlag[%flag.team], 1, %flag.team);
|
||||
}
|
||||
%player.unMountImage($FlagSlot);
|
||||
%flag.hide(false); //Does the throwItem function handle this?
|
||||
%flag.hide(false); //Does the throwItem function handle this?
|
||||
|
||||
%teamName = %game.getTeamName(%flag.team);
|
||||
messageTeamExcept(%client, 'MsgCTFFlagDropped', '\c2Teammate %1 dropped the %2 flag. (Held: %4)~wfx/misc/flag_drop.wav', %client.name, %teamName, %flag.team, %held); // z0dd - ZOD, 8/15/02. How long flag was held
|
||||
|
|
@ -866,6 +907,72 @@ function SCtFGame::flagCap(%game, %player)
|
|||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag?
|
||||
|
||||
%game.playerLostFlagTarget(%player);
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
{
|
||||
%held2 = getSimTime() - %game.totalFlagHeldTime[%flag];
|
||||
%realtime = %game.formatTime(%held2, true);
|
||||
%record = false;
|
||||
if(%game.totalFlagHeldTime[%flag])
|
||||
{
|
||||
if(%client.team == 1)
|
||||
{
|
||||
if((%held2 < $flagstats::heldTeam1) || $flagstats::heldTeam1 == 0)
|
||||
{
|
||||
if($HostGamePlayerCount >= $Host::MinFlagRecordPlayerCount)
|
||||
{
|
||||
$flagstats::heldTeam1 = %held2;
|
||||
$flagstats::realTeam1 = %realTime;
|
||||
$flagstats::nickTeam1 = %client.nameBase;
|
||||
}
|
||||
%record = true;
|
||||
}
|
||||
}
|
||||
else if(%client.team == 2)
|
||||
{
|
||||
if((%held2 < $flagstats::heldTeam2) || $flagstats::heldTeam2 == 0)
|
||||
{
|
||||
if($HostGamePlayerCount >= $Host::MinFlagRecordPlayerCount)
|
||||
{
|
||||
$flagstats::heldTeam2 = %held2;
|
||||
$flagstats::realTeam2 = %realTime;
|
||||
$flagstats::nickTeam2 = %client.nameBase;
|
||||
}
|
||||
%record = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(%record == true)
|
||||
{
|
||||
if($HostGamePlayerCount >= $Host::MinFlagRecordPlayerCount)
|
||||
{
|
||||
%fileOut = "stats/maps/classic/" @ $CurrentMissionType @ "/" @ $CurrentMission @ ".txt";
|
||||
export("$flagstats::*", %fileOut, false);
|
||||
schedule(4000, 0, "messageAll", 'MsgCTFNewRecord', "\c2It's a new record! Time: \c3"@%realtime@"\c2.~wfx/misc/hunters_horde.wav");
|
||||
}
|
||||
else
|
||||
schedule(4000, 0, "messageClient", %client, '', "\c2Minimum of" SPC $Host::MinFlagRecordPlayerCount SPC "Players to set a new flag record.");
|
||||
}
|
||||
}
|
||||
|
||||
if(!$Host::TournamentMode)
|
||||
bottomprint(%client, "You captured the flag in " @ %realTime @ " seconds", 3);
|
||||
|
||||
$stats::caps[%client]++;
|
||||
if($stats::caps[%client] > $stats::caps_counter)
|
||||
{
|
||||
$stats::caps_counter = $stats::caps[%client];
|
||||
$stats::caps_client = getTaggedString(%client.name);
|
||||
}
|
||||
|
||||
if(%held2 < $stats::fastestCap || !$stats::fastestCap)
|
||||
{
|
||||
$stats::fastestCap = %held2;
|
||||
$stats::fastcap_time = %realTime;
|
||||
$stats::fastcap_client = getTaggedString(%client.name);
|
||||
}
|
||||
}
|
||||
|
||||
//award points to player and team
|
||||
%teamName = %game.getTeamName(%flag.team);
|
||||
messageTeamExcept(%client, 'MsgCTFFlagCapped', '\c2%1 captured the %2 flag! (Held: %5)~wfx/misc/flag_capture.wav', %client.name, %teamName, %flag.team, %client.team, %held);
|
||||
|
|
@ -916,6 +1023,23 @@ function SCtFGame::flagReturn(%game, %flag, %player)
|
|||
else
|
||||
%otherTeam = 1;
|
||||
%teamName = %game.getTeamName(%flag.team);
|
||||
|
||||
// when the flag return, stop observing the flag, and go in observerFly mode
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if(%cl.team <= 0 && %cl.observingFlag && %cl.flagObsTeam == %flag.team)
|
||||
{
|
||||
%cl.camera.mode = "observerFly";
|
||||
%cl.camera.setFlyMode();
|
||||
updateObserverFlyHud(%cl);
|
||||
|
||||
%cl.observingFlag = false;
|
||||
%cl.flagObserved = "";
|
||||
%cl.flagObsTeam = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (%player !$= "")
|
||||
{
|
||||
//a player returned it
|
||||
|
|
@ -1814,7 +1938,10 @@ function SCtFGame::boundaryLoseFlag(%game, %player)
|
|||
%flag.setCollisionTimeout(%player);
|
||||
|
||||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false); // z0dd - ZOD, 8/15/02. How long did player hold flag?
|
||||
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
%game.totalFlagHeldTime[%flag] = 0;
|
||||
|
||||
%game.playerDroppedFlag(%player);
|
||||
|
||||
// now for the tricky part -- throwing the flag back into the mission area
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ $VoteMessage["VoteArmorLimits", 1] = "disable armor limiting";
|
|||
$VoteMessage["VoteAntiTurtleTime"] = "change the anti turtle time to";
|
||||
$VoteMessage["VoteArmorClass"] = "change the armor class to";
|
||||
$VoteMessage["VoteClearServer"] = "clear server for match";
|
||||
$VoteMessage["VoteSkipMission"] = "skip the mission to";
|
||||
$VoteMessage["VoteSkipMission"] = "skip the mission";
|
||||
|
||||
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %playerVote)
|
||||
{
|
||||
|
|
@ -146,6 +146,9 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
|
|||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
%VoteSoundRandom = getRandom(1,100);
|
||||
$VoteSoundRandom = %VoteSoundRandom;
|
||||
$VoteSoundSchedule = schedule(10000, 0, "VoteSound", %game, %typename, %arg1, %arg2, %VoteSoundRandom);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -158,6 +161,9 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
|
|||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
%VoteSoundRandom = getRandom(1,100);
|
||||
$VoteSoundRandom = %VoteSoundRandom;
|
||||
$VoteSoundSchedule = schedule(10000, 0, "VoteSound", %game, %typename, %arg1, %arg2, %VoteSoundRandom);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -173,6 +179,21 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ( %typeName $= "VoteSkipMission" )
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
{
|
||||
messageClient( %cl, 'VoteStarted', '\c2%1 initiated a vote to %2.', %client.name, %actionMsg, %arg1.name);
|
||||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
%VoteSoundRandom = getRandom(1,100);
|
||||
$VoteSoundRandom = %VoteSoundRandom;
|
||||
$VoteSoundSchedule = schedule(10000, 0, "VoteSound", %game, %typename, %arg1, %arg2, %VoteSoundRandom);
|
||||
}
|
||||
else if ( %typeName $= "VoteChangeMission" )
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
|
|
@ -184,6 +205,9 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
|
|||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
%VoteSoundRandom = getRandom(1,100);
|
||||
$VoteSoundRandom = %VoteSoundRandom;
|
||||
$VoteSoundSchedule = schedule(10000, 0, "VoteSound", %game, %typename, %arg1, %arg2, %VoteSoundRandom);
|
||||
}
|
||||
else if (%arg1 !$= 0)
|
||||
{
|
||||
|
|
@ -203,6 +227,9 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
|
|||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
%VoteSoundRandom = getRandom(1,100);
|
||||
$VoteSoundRandom = %VoteSoundRandom;
|
||||
$VoteSoundSchedule = schedule(10000, 0, "VoteSound", %game, %typename, %arg1, %arg2, %VoteSoundRandom);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -225,7 +252,10 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
|
|||
}
|
||||
else
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
if( %arg1 == 999 )
|
||||
%arg1 = "unlimited";
|
||||
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %idx );
|
||||
if ( !%cl.isAIControlled() )
|
||||
|
|
@ -234,6 +264,9 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
|
|||
%clientsVoting++;
|
||||
}
|
||||
}
|
||||
%VoteSoundRandom = getRandom(1,100);
|
||||
$VoteSoundRandom = %VoteSoundRandom;
|
||||
$VoteSoundSchedule = schedule(10000, 0, "VoteSound", %game, %typename, %arg1, %arg2, %VoteSoundRandom);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
489
Classic/scripts/autoexec/AntiLouExploitFixes.cs
Normal file
489
Classic/scripts/autoexec/AntiLouExploitFixes.cs
Normal file
|
|
@ -0,0 +1,489 @@
|
|||
//Taco October 2018
|
||||
//removed alot of things that were already included in the classic code
|
||||
//and checked if evo wasnt double overriding functions
|
||||
|
||||
package AntiLouExploitFixes
|
||||
{
|
||||
|
||||
// MPB INSTANT ENERGY FIX
|
||||
|
||||
// VehicleData::onRemove(%this, %obj)
|
||||
// Info: this is called after the MPB is destroyed. Reset the variable
|
||||
function VehicleData::onRemove(%this, %obj)
|
||||
{
|
||||
if(%obj.station.isDestroyed)
|
||||
%obj.station.isDestroyed = 0;
|
||||
|
||||
parent::onRemove(%this, %obj);
|
||||
}
|
||||
|
||||
|
||||
// stationTrigger::onEnterTrigger(%data, %obj, %colObj)
|
||||
// Info: If the MPB is destroyed, don't allow players to use the inv
|
||||
function stationTrigger::onEnterTrigger(%data, %obj, %colObj)
|
||||
{
|
||||
//make sure it's a player object, and that that object is still alive
|
||||
if(%colObj.getDataBlock().className !$= "Armor" || %colObj.getState() $= "Dead")
|
||||
return;
|
||||
|
||||
|
||||
// Part of hack to keep people from mounting vehicles in disallowed armors.
|
||||
if(%obj.station.getDataBlock().getName() !$= "StationVehicle")
|
||||
%colObj.client.inInv = true;
|
||||
|
||||
%colObj.inStation = true;
|
||||
commandToClient(%colObj.client,'setStationKeys', true);
|
||||
|
||||
if(Game.stationOnEnterTrigger(%data, %obj, %colObj))
|
||||
{
|
||||
//verify station.team is team associated and isn't on player's team
|
||||
if((%obj.mainObj.team != %colObj.client.team) && (%obj.mainObj.team != 0))
|
||||
{
|
||||
messageClient(%colObj.client, 'msgStationDenied', '\c2Access Denied -- Wrong team.~wfx/powered/station_denied.wav');
|
||||
}
|
||||
else if(%obj.disableObj.isDisabled())
|
||||
{
|
||||
messageClient(%colObj.client, 'msgStationDisabled', '\c2Station is disabled.');
|
||||
}
|
||||
else if(!%obj.mainObj.isPowered())
|
||||
{
|
||||
messageClient(%colObj.client, 'msgStationNoPower', '\c2Station is not powered.');
|
||||
}
|
||||
else if(%obj.station.notDeployed)
|
||||
{
|
||||
messageClient(%colObj.client, 'msgStationNotDeployed', '\c2Station is not deployed.');
|
||||
}
|
||||
else if(%obj.station.isDestroyed)
|
||||
{
|
||||
messageClient(%colObj.client, 'msgStationDestroyed', '\c2Station is destroyed.');
|
||||
}
|
||||
else if(%obj.station.triggeredBy $= "")
|
||||
{
|
||||
if(%obj.station.getDataBlock().setPlayersPosition(%obj.station, %obj, %colObj))
|
||||
{
|
||||
messageClient(%colObj.client, 'CloseHud', "", 'inventoryScreen');
|
||||
commandToClient(%colObj.client, 'TogglePlayHuds', true);
|
||||
%obj.station.triggeredBy = %colObj;
|
||||
%obj.station.getDataBlock().stationTriggered(%obj.station, 1);
|
||||
%colObj.station = %obj.station;
|
||||
%colObj.lastWeapon = ( %colObj.getMountedImage($WeaponSlot) == 0 ) ? "" : %colObj.getMountedImage($WeaponSlot).getName().item;
|
||||
%colObj.unmountImage($WeaponSlot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// END MPB INSTANT ENERGY FIX
|
||||
|
||||
// VEHICLE STATION SPAM FIX
|
||||
|
||||
// serverCmdBuyVehicle(%client, %blockName)
|
||||
// Info: Fix an exploit that makes the server lag.
|
||||
function serverCmdBuyVehicle(%client, %blockName)
|
||||
{
|
||||
// if the client has already created a vehicle, don't execute the function
|
||||
if(%client.cantBuyVehicle)
|
||||
return;
|
||||
|
||||
%team = %client.getSensorGroup();
|
||||
if(vehicleCheck(%blockName, %team))
|
||||
{
|
||||
%station = %client.player.station.pad;
|
||||
if((%station.ready) && (%station.station.vehicle[%blockName]))
|
||||
{
|
||||
%trans = %station.getTransform();
|
||||
%pos = getWords(%trans, 0, 2);
|
||||
%matrix = VectorOrthoBasis(getWords(%trans, 3, 6));
|
||||
%yrot = getWords(%matrix, 3, 5);
|
||||
%p = vectorAdd(%pos,vectorScale(%yrot, -3));
|
||||
%p = getWords(%p, 0, 1) @ " " @ getWord(%p, 2) + 4;
|
||||
%p = vectorAdd(%p, %blockName.spawnOffset);
|
||||
%rot = getWords(%trans, 3, 5);
|
||||
%angle = getWord(%trans, 6) + 3.14;
|
||||
%mask = $TypeMasks::VehicleObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StationObjectType | $TypeMasks::TurretObjectType;
|
||||
InitContainerRadiusSearch(%p, %blockName.checkRadius, %mask);
|
||||
|
||||
%clear = 1;
|
||||
for(%x = 0; (%obj = containerSearchNext()) != 0; %x++)
|
||||
{
|
||||
if((%obj.getType() & $TypeMasks::VehicleObjectType) && (%obj.getDataBlock().checkIfPlayersMounted(%obj)))
|
||||
{
|
||||
%clear = 0;
|
||||
break;
|
||||
}
|
||||
else
|
||||
%removeObjects[%x] = %obj;
|
||||
}
|
||||
|
||||
if(%clear)
|
||||
{
|
||||
%fadeTime = 0;
|
||||
for(%i = 0; %i < %x; %i++)
|
||||
{
|
||||
if(%removeObjects[%i].getType() & $TypeMasks::PlayerObjectType)
|
||||
{
|
||||
%pData = %removeObjects[%i].getDataBlock();
|
||||
%pData.damageObject(%removeObjects[%i], 0, "0 0 0", 1000, $DamageType::VehicleSpawn);
|
||||
}
|
||||
else
|
||||
{
|
||||
%removeObjects[%i].mountable = 0;
|
||||
%removeObjects[%i].startFade(1000, 0, true);
|
||||
%removeObjects[%i].schedule(1001, "delete");
|
||||
%fadeTime = 1500;
|
||||
}
|
||||
}
|
||||
// client has buyed a vehicle
|
||||
%client.cantBuyVehicle = 1;
|
||||
schedule(%fadeTime, 0, "createVehicle", %client, %station, %blockName, %team , %p, %rot, %angle);
|
||||
// wait 6,5 seconds (time a vehicle needs to be created) before buying another vehicle
|
||||
schedule(6500, 0, "resetBuyVehicle", %client);
|
||||
}
|
||||
else
|
||||
MessageClient(%client, "", 'Can\'t create vehicle. A player is on the creation pad.');
|
||||
}
|
||||
|
||||
else
|
||||
messageClient(%client, "", "~wfx/misc/misc.error.wav");
|
||||
}
|
||||
|
||||
else
|
||||
messageClient(%client, "", "~wfx/misc/misc.error.wav");
|
||||
}
|
||||
|
||||
// resetBuyVehicle(%client)
|
||||
// Info: delete the variable, so client can buy another vehicle
|
||||
function resetBuyVehicle(%client)
|
||||
{
|
||||
%client.cantBuyVehicle = "";
|
||||
}
|
||||
|
||||
// END VEHICLE STATION SPAM FIX
|
||||
|
||||
|
||||
// ShapeBase::throwObject(%this,%obj)
|
||||
// Info: Delay on calculating flag stats
|
||||
function ShapeBase::throwObject(%this,%obj)
|
||||
{
|
||||
// z0dd - ZOD, 4/15/02. Allow respawn switching during tourney wait.
|
||||
if(!$MatchStarted)
|
||||
return;
|
||||
|
||||
// z0dd - ZOD, 5/26/02. Remove anti-hover so flag can be thrown properly
|
||||
if(%obj.getDataBlock().getName() $= "Flag")
|
||||
{
|
||||
%obj.static = false;
|
||||
// z0dd - ZOD - SquirrelOfDeath, 10/02/02. Hack for flag collision bug.
|
||||
if(Game.Class $= CTFGame || Game.Class $= PracticeCTFGame)
|
||||
%obj.searchSchedule = Game.schedule(10, "startFlagCollisionSearch", %obj);
|
||||
}
|
||||
|
||||
%srcCorpse = (%this.getState() $= "Dead"); // z0dd - ZOD, 4/14/02. Flag tossed from corpse
|
||||
|
||||
//if the object is being thrown by a corpse, use a random vector
|
||||
if (%srcCorpse && %obj.getDataBlock().getName() !$= "Flag") // z0dd - ZOD, 4/14/02. Except for flags..
|
||||
{
|
||||
%vec = (-1.0 + getRandom() * 2.0) SPC (-1.0 + getRandom() * 2.0) SPC getRandom();
|
||||
%vec = vectorScale(%vec, 10);
|
||||
}
|
||||
else // else Initial vel based on the dir the player is looking
|
||||
{
|
||||
%eye = %this.getEyeVector();
|
||||
%vec = vectorScale(%eye, 20);
|
||||
}
|
||||
|
||||
// Add a vertical component to give the item a better arc
|
||||
%dot = vectorDot("0 0 1",%eye);
|
||||
if (%dot < 0)
|
||||
%dot = -%dot;
|
||||
%vec = vectorAdd(%vec,vectorScale("0 0 12",1 - %dot)); // z0dd - ZOD, 9/10/02. 10 was 8
|
||||
|
||||
// Add player's velocity
|
||||
%vec = vectorAdd(%vec,%this.getVelocity());
|
||||
%pos = getBoxCenter(%this.getWorldBox());
|
||||
|
||||
//since flags have a huge mass (so when you shoot them, they don't bounce too far)
|
||||
//we need to up the %vec so that you can still throw them...
|
||||
if (%obj.getDataBlock().getName() $= "Flag")
|
||||
{
|
||||
%vec = vectorScale(%vec, (%srcCorpse ? 40 : 75)); // z0dd - ZOD, 4/14/02. Throw flag force. Value was 40
|
||||
|
||||
// z0dd - ZOD, 9/27/02. Delay on grabbing flag after tossing it
|
||||
%this.flagTossWait = true;
|
||||
%this.schedule(1000, resetFlagTossWait);
|
||||
|
||||
// Delay on calculating stats
|
||||
%this.flagStatsWait = true;
|
||||
%this.schedule(5000, resetFlagStatsWait);
|
||||
}
|
||||
|
||||
//
|
||||
%obj.setTransform(%pos);
|
||||
%obj.applyImpulse(%pos,%vec);
|
||||
%obj.setCollisionTimeout(%this);
|
||||
%data = %obj.getDatablock();
|
||||
|
||||
%data.onThrow(%obj, %this);
|
||||
|
||||
//call the AI hook
|
||||
AIThrowObject(%obj);
|
||||
}
|
||||
|
||||
// Player::resetFlagStatsWait(%this)
|
||||
// Info: Delay on calculating the stats
|
||||
function Player::resetFlagStatsWait(%this)
|
||||
{
|
||||
%this.flagStatsWait = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Fix for observer vehicle bug, where observers are drawn to
|
||||
// a vehicle no matter whether they are observing the client or not
|
||||
// Thanks to MT for pointing out.
|
||||
function resetObserveFollow( %client, %dismount )
|
||||
{
|
||||
if( %dismount )
|
||||
{
|
||||
if( !isObject( %client.player ) )
|
||||
return;
|
||||
|
||||
for( %i = 0; %i < %client.observeCount; %i++ )
|
||||
{
|
||||
// Check if data in %client.observers[%i] is correct at all
|
||||
if ( %client.observers[%i].clientObserve != %client )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
%client.observers[%i].camera.setOrbitMode( %client.player, %client.player.getTransform(), 0.5, 4.5, 4.5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( !%client.player.isMounted() )
|
||||
return;
|
||||
|
||||
// grab the vehicle...
|
||||
%mount = %client.player.getObjectMount();
|
||||
if( %mount.getDataBlock().observeParameters $= "" )
|
||||
%params = %client.player.getTransform();
|
||||
else
|
||||
%params = %mount.getDataBlock().observeParameters;
|
||||
|
||||
for( %i = 0; %i < %client.observeCount; %i++ )
|
||||
{
|
||||
// Check if data in %client.observers[%i] is correct at all
|
||||
if ( %client.observers[%i].clientObserve != %client )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
%client.observers[%i].camera.setOrbitMode(%mount, %mount.getTransform(), getWord( %params, 0 ), getWord( %params, 1 ), getWord( %params, 2 ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ilys - Start checkSpeed schedule on MPB
|
||||
function MobileBaseVehicle::onAdd(%this, %obj)
|
||||
{
|
||||
Parent::onAdd(%this, %obj);
|
||||
%obj.schedule(5000, "checkSpeed", %obj);
|
||||
}
|
||||
|
||||
// ilys - checkSpeed function. Kill the driver and MPB if going too fast.
|
||||
function WheeledVehicle::checkSpeed(%data, %obj)
|
||||
{
|
||||
if(VectorLen(%obj.getVelocity()) > 200)
|
||||
{
|
||||
if(%obj.getMountNodeObject(0)) %obj.getMountNodeObject(0).scriptKill(36);
|
||||
%obj.setDamagelevel(4);
|
||||
}
|
||||
%obj.schedule(5000, "checkSpeed", %data, %obj);
|
||||
}
|
||||
|
||||
// ilys - No lava, please.
|
||||
function StationVehiclePad::createStationVehicle(%data, %obj)
|
||||
{
|
||||
%group = %obj.getGroup();
|
||||
%xform = %obj.getSlotTransform(0);
|
||||
%position = getWords(%xform, 0, 2);
|
||||
%rotation = getWords(%xform, 3, 5);
|
||||
%angle = (getWord(%xform, 6) * 180) / 3.14159;
|
||||
if(%obj.stationPos $= "" || %obj.stationRot $= "")
|
||||
{
|
||||
%pos = %position;
|
||||
%rot = %rotation @ " " @ %angle;
|
||||
}
|
||||
else
|
||||
{
|
||||
%pos = %obj.stationPos;
|
||||
%rot = %obj.stationRot;
|
||||
}
|
||||
%sv = new StaticShape() {
|
||||
scale = "1 1 1";
|
||||
dataBlock = "StationVehicle";
|
||||
lockCount = "0";
|
||||
homingCount = "0";
|
||||
team = %obj.team;
|
||||
position = %pos;
|
||||
rotation = %rot;
|
||||
};
|
||||
%group.add(%sv);
|
||||
%sv.setPersistent(false);
|
||||
%sv.getDataBlock().gainPower(%sv);
|
||||
%sv.getDataBlock().createTrigger(%sv);
|
||||
%sv.pad = %obj;
|
||||
%obj.station = %sv;
|
||||
%sv.trigger.mainObj = %obj;
|
||||
%sv.trigger.disableObj = %sv;
|
||||
if(%sv.getTarget() != -1)
|
||||
setTargetSensorGroup(%sv.getTarget(), %obj.team);
|
||||
if(%obj.scoutVehicle !$= "Removed")
|
||||
%sv.vehicle[scoutvehicle] = true;
|
||||
if(%obj.assaultVehicle !$= "Removed")
|
||||
%sv.vehicle[assaultVehicle] = true;
|
||||
if(%obj.mobileBaseVehicle !$= "Removed")
|
||||
{
|
||||
// ilys - Removed lava waterblock code from here
|
||||
%sv.vehicle[mobileBasevehicle] = true;
|
||||
%sv.getDataBlock().createTeleporter(%sv, %group);
|
||||
}
|
||||
if(%obj.scoutFlyer !$= "Removed")
|
||||
%sv.vehicle[scoutFlyer] = true;
|
||||
if(%obj.bomberFlyer !$= "Removed")
|
||||
%sv.vehicle[bomberFlyer] = true;
|
||||
if(%obj.hapcFlyer !$= "Removed")
|
||||
%sv.vehicle[hapcFlyer] = true;
|
||||
}
|
||||
|
||||
// ilys - We dont do anything here now
|
||||
function serverCmdClientTeamChange( %client )
|
||||
{
|
||||
// Don't do it, man. DON'T DO IT!
|
||||
}
|
||||
|
||||
// ilys - Only allow the client to force play when the match has started
|
||||
function serverCmdClientJoinGame(%client)
|
||||
{
|
||||
if(!$MatchStarted) return;
|
||||
parent::serverCmdClientJoinGame(%client);
|
||||
}
|
||||
|
||||
function serverCmdPlayAnim(%client, %anim)
|
||||
{
|
||||
// Not used in Classic
|
||||
}
|
||||
|
||||
// ilys - Do not allow animations inside a forcefield.
|
||||
// ilys - Unmount the mortar and grenade launcher on animation.
|
||||
function PlayAnim(%client, %anim)
|
||||
{
|
||||
if( %anim $= "Death1" || %anim $= "Death2" || %anim $= "Death3" || %anim $= "Death4" || %anim $= "Death5" ||
|
||||
%anim $= "Death6" || %anim $= "Death7" || %anim $= "Death8" || %anim $= "Death9" || %anim $= "Death10" ||
|
||||
%anim $= "Death11" || %anim $= "sitting" || %anim $= "scoutRoot" || %anim $= "look" || %anim $= "lookms" ||
|
||||
%anim $= "looknw" || %anim $= "head" || %anim $= "headSide" || %anim $= "ski" || %anim $= "light_recoil")
|
||||
return;
|
||||
|
||||
%player = %client.player;
|
||||
if(!isObject(%player))
|
||||
return;
|
||||
if(%player.isMounted() || %player.isInForceField())
|
||||
return;
|
||||
|
||||
%weapon = ( %player.getMountedImage($WeaponSlot) == 0 ) ? "" : %player.getMountedImage($WeaponSlot).getName().item;
|
||||
if(%weapon $= "MissileLauncher" || %weapon $= "GrenadeLauncher" || %weapon $= "SniperRifle" || %weapon $= "Mortar")
|
||||
{
|
||||
%player.animResetWeapon = true;
|
||||
%player.lastWeapon = %weapon;
|
||||
%player.unmountImage($WeaponSlot);
|
||||
%player.setArmThread(look);
|
||||
}
|
||||
%player.setActionThread(%anim);
|
||||
}
|
||||
|
||||
// ilys - Fix for the Standing Pilot bug
|
||||
function Armor::onMount(%this,%obj,%vehicle,%node)
|
||||
{
|
||||
if (%node == 0)
|
||||
{
|
||||
%obj.setTransform("0 0 0 0 0 1 0");
|
||||
%obj.setActionThread(%vehicle.getDatablock().mountPose[%node],true,true);
|
||||
%obj.schedule(300,"setActionThread",%vehicle.getDatablock().mountPose[%node],true,true);
|
||||
if(!%obj.inStation) %obj.lastWeapon = (%obj.getMountedImage($WeaponSlot) == 0 ) ? "" : %obj.getMountedImage($WeaponSlot).item;
|
||||
%obj.unmountImage($WeaponSlot);
|
||||
if(!%obj.client.isAIControlled())
|
||||
{
|
||||
%obj.setControlObject(%vehicle);
|
||||
%obj.client.setObjectActiveImage(%vehicle, 2);
|
||||
}
|
||||
if(%obj == %obj.lastVehicle.lastPilot && %obj.lastVehicle != %vehicle)
|
||||
{
|
||||
schedule(15000, %obj.lastVehicle,"vehicleAbandonTimeOut", %obj.lastVehicle);
|
||||
%obj.lastVehicle.lastPilot = "";
|
||||
}
|
||||
if(%vehicle.lastPilot !$= "" && %vehicle == %vehicle.lastPilot.lastVehicle) %vehicle.lastPilot.lastVehicle = "";
|
||||
%vehicle.abandon = false;
|
||||
%vehicle.lastPilot = %obj;
|
||||
%obj.lastVehicle = %vehicle;
|
||||
if((%vehicle.getTarget() != -1) && %vehicle.getDatablock().cantTeamSwitch $= "")
|
||||
{
|
||||
setTargetSensorGroup(%vehicle.getTarget(), %obj.client.getSensorGroup());
|
||||
if( %vehicle.turretObject > 0 ) setTargetSensorGroup(%vehicle.turretObject.getTarget(), %obj.client.getSensorGroup());
|
||||
}
|
||||
commandToClient( %obj.client, 'VehicleMount' );
|
||||
}
|
||||
else
|
||||
{
|
||||
if(%vehicle.getDataBlock().mountPose[%node] !$= "") %obj.setActionThread(%vehicle.getDatablock().mountPose[%node]);
|
||||
else %obj.setActionThread("root", true);
|
||||
}
|
||||
if(%vehicle.getDatablock().numMountPoints > 1)
|
||||
{
|
||||
%nodeName = findNodeName(%vehicle, %node); // function in vehicle.cs
|
||||
for(%i = 0; %i < %vehicle.getDatablock().numMountPoints; %i++)
|
||||
{
|
||||
if (%vehicle.getMountNodeObject(%i) > 0)
|
||||
{
|
||||
if(%vehicle.getMountNodeObject(%i).client != %obj.client)
|
||||
{
|
||||
%team = (%obj.team == %vehicle.getMountNodeObject(%i).client.team ? 'Teammate' : 'Enemy');
|
||||
messageClient( %vehicle.getMountNodeObject(%i).client, 'MsgShowPassenger', '\c2%3: \c3%1\c2 has boarded in the \c3%2\c2 position.', %obj.client.name, %nodeName, %team );
|
||||
}
|
||||
commandToClient( %vehicle.getMountNodeObject(%i).client, 'showPassenger', %node, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( %obj.getImageTrigger( $BackpackSlot ) ) %obj.setImageTrigger( $BackpackSlot, false );
|
||||
%obj.client.vehicleMounted = %vehicle;
|
||||
AIVehicleMounted(%vehicle);
|
||||
if(%obj.client.isAIControlled()) %this.AIonMount(%obj, %vehicle, %node);
|
||||
}
|
||||
|
||||
// TracerDX/ilys - Server crash exploit fix
|
||||
function serverCmdTeamMessageSent(%client, %text)
|
||||
{
|
||||
if((%client.voice $= "") && (strstr(%text, "~w") != -1) && (getSubStr(%text, (strlen(%text) - 4), 4) !$= ".wav")) return;
|
||||
parent::serverCmdTeamMessageSent(%client, %text);
|
||||
}
|
||||
|
||||
function serverCmdMessageSent(%client, %text)
|
||||
{
|
||||
if((%client.voice $= "") && (strstr(%text, "~w") != -1) && (getSubStr(%text, (strlen(%text) - 4), 4) !$= ".wav")) return;
|
||||
parent::serverCmdMessageSent(%client, %text);
|
||||
}
|
||||
|
||||
// Fix a problem with the package system
|
||||
// dropping the first package when a non-active
|
||||
// package is deactivated
|
||||
function DeactivatePackage(%this)
|
||||
{
|
||||
if(!isActivePackage(%this)) return;
|
||||
parent::DeactivatePackage(%this);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(AntiLouExploitFixes))
|
||||
activatePackage(AntiLouExploitFixes);
|
||||
|
|
@ -27,26 +27,13 @@ function Autobalance( %game, %AutobalanceSafetynetTrys )
|
|||
//Reset
|
||||
%lastclient1 = "";
|
||||
%lastclient2 = "";
|
||||
|
||||
//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]++;
|
||||
}
|
||||
|
||||
//Difference Variables
|
||||
%team1difference = $PlayerCount[1] - $PlayerCount[2];
|
||||
%team2difference = $PlayerCount[2] - $PlayerCount[1];
|
||||
%team1difference = $TeamRank[1, count] - $TeamRank[2, count];
|
||||
%team2difference = $TeamRank[2, count] - $TeamRank[1, count];
|
||||
|
||||
//If even, stop.
|
||||
if( %team1difference == 1 || %team2difference == 1 || $PlayerCount[1] == $PlayerCount[2] )
|
||||
if( %team1difference == 1 || %team2difference == 1 || $TeamRank[1, count] == $TeamRank[2, count] )
|
||||
{
|
||||
//Reset TBN
|
||||
ResetTBNStatus();
|
||||
|
|
@ -112,7 +99,8 @@ function Autobalance( %game, %AutobalanceSafetynetTrys )
|
|||
|
||||
// Fire Autobalance
|
||||
Game.clientChangeTeam( %client, %otherTeam, 0 );
|
||||
messageAll('MsgTeamBalanceNotify', '~wfx/powered/vehicle_screen_on.wav');
|
||||
messageClient(%client, 'MsgTeamBalanceNotify', "\c0You were switched to the other team for balancing.~wfx/powered/vehicle_screen_on.wav");
|
||||
messageAllExcept(%client, -1, 'MsgTeamBalanceNotify', "~wfx/powered/vehicle_screen_on.wav");
|
||||
|
||||
//Trigger GetCounts
|
||||
ResetGetCountsStatus();
|
||||
|
|
|
|||
61
Classic/scripts/autoexec/EnableLogs.cs
Normal file
61
Classic/scripts/autoexec/EnableLogs.cs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
$Host::ClassicAdminLog = 1;
|
||||
$Host::ClassicConnectLog = 1;
|
||||
//exec("scripts/autoexec/EnableLogs.cs");
|
||||
|
||||
//Enable Logs
|
||||
setlogmode(1);
|
||||
|
||||
// adminLog(%client, %msg)
|
||||
// Info: Logs the admin events
|
||||
function adminLog(%client, %msg)
|
||||
{
|
||||
if(%client.isAdmin && $Host::ClassicAdminLog)
|
||||
{
|
||||
// get the client info
|
||||
%authInfo = %client.getAuthInfo();
|
||||
%ip = getField(strreplace(%client.getAddress(),":","\t"),1);
|
||||
|
||||
// this is the info that will be logged
|
||||
$AdminLog = formatTimeString("M-d") SPC formatTimeString("[HH:nn]") SPC %client.nameBase @ " (" @ getField(%authInfo, 0) @ ", " @ %ip @ ", " @ %client.guid @ ", " @ %client.getAddress() @ ")" @ %msg SPC "[" @ $CurrentMission @ "]";
|
||||
|
||||
%logpath = $Host::ClassicAdminLogPath;
|
||||
export("$AdminLog", %logpath, true);
|
||||
logEcho($AdminLog);
|
||||
echo($AdminLog);
|
||||
}
|
||||
}
|
||||
|
||||
// connectLog(%client, %realname, %tag)
|
||||
// Info: Logs the connections
|
||||
function connectLog(%client, %isDisconnect)
|
||||
{
|
||||
if($Host::ClassicConnectLog && !%client.isAIControlled())
|
||||
{
|
||||
// get the client info
|
||||
%authInfo = %client.getAuthInfo();
|
||||
%ip = getField(strreplace(%client.getAddress(),":","\t"),1);
|
||||
|
||||
// net tournament client present?
|
||||
if (!%client.t2csri_sentComCertDone)
|
||||
%ntc = "N";
|
||||
else
|
||||
%ntc = "Y";
|
||||
|
||||
if(%isDisconnect)
|
||||
%inout = "[Drop]";
|
||||
else
|
||||
%inout = "[Join]";
|
||||
|
||||
if(%client.isSmurf)
|
||||
%name = stripChars( detag( getTaggedString( %client.name ) ), "\cp\co\c6\c7\c8\c9" );
|
||||
else
|
||||
%name = %client.nameBase;
|
||||
|
||||
$ConnectLog = %inout SPC "#P[" @ $HostGamePlayerCount @ "]" SPC formatTimeString("M-d") SPC formatTimeString("[HH:nn]") SPC %name SPC "(" @ getField(%authInfo, 0) @ "," SPC %client.guid @ "," SPC %ip @ ")" SPC "[" @ $CurrentMission @ "]" SPC "NTC[" @ %ntc @ "]";
|
||||
|
||||
%logpath = $Host::ClassicConnLogPath;
|
||||
export("$ConnectLog", %logpath, true);
|
||||
logEcho($ConnectLog);
|
||||
echo($ConnectLog);
|
||||
}
|
||||
}
|
||||
431
Classic/scripts/autoexec/EvoStats.cs
Normal file
431
Classic/scripts/autoexec/EvoStats.cs
Normal file
|
|
@ -0,0 +1,431 @@
|
|||
// Eolk - People like evo's stats a lot... so that's what we'll give them...
|
||||
$weap_message[1] = "Blaster master";
|
||||
$weap_message[2] = "Plasma roaster";
|
||||
$weap_message[3] = "Chainwh0re";
|
||||
$weap_message[4] = "Disc-O-maniac";
|
||||
$weap_message[5] = "Grenade puppy";
|
||||
$weap_message[6] = "Laser turret";
|
||||
$weap_message[8] = "Mortar maniac";
|
||||
$weap_message[9] = "Missile lamer";
|
||||
$weap_message[10] = "Shocklance bee";
|
||||
$weap_message[11] = "Mine mayhem";
|
||||
$weap_message[13] = "Road killer";
|
||||
// Extra Stats
|
||||
$weap_message[31] = "Demoman";
|
||||
$weap_message[21] = "Clamp Farmer";
|
||||
$weap_message[22] = "Spike Farmer";
|
||||
$weap_message[26] = "Shrike Gunner";
|
||||
$weap_message[27] = "Tailgunner";
|
||||
$weap_message[28] = "Bombardier";
|
||||
$weap_message[29] = "Tank Gunner (chain)";
|
||||
$weap_message[30] = "Tank Gunner (mortar)";
|
||||
$weap_message[31] = "Satchel Punk";
|
||||
$weap_message[50] = "Combo King (mine+disc)";
|
||||
|
||||
// Handlers
|
||||
package EvoStatHandles
|
||||
{
|
||||
|
||||
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
||||
{
|
||||
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||
// call the function
|
||||
if(!$Host::TournamentMode)
|
||||
handleDamageStat(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||
}
|
||||
|
||||
function DefaultGame::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation)
|
||||
{
|
||||
Parent::onClientKilled(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation);
|
||||
// call the function
|
||||
if(!$Host::TournamentMode)
|
||||
handleKillStat(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||
}
|
||||
|
||||
function ProjectileData::onCollision(%data, %projectile, %targetObject, %modifier, %position, %normal)
|
||||
{
|
||||
if(isObject(%targetObject)) // Console spam fix.
|
||||
{
|
||||
// call the function
|
||||
if(!$Host::TournamentMode)
|
||||
handleMAStat(%data, %projectile, %targetObject, %modifier, %position, %normal);
|
||||
}
|
||||
Parent::onCollision( %data, %projectile, %targetObject, %modifier, %position, %normal );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(EvoStatHandles))
|
||||
activatePackage(EvoStatHandles);
|
||||
|
||||
// handleDamageStat(%targetObject, %sourceObject, %position, %amount, %damageType)
|
||||
// Info: Calcs: Damage and SnipeShot detection.
|
||||
function handleDamageStat(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
||||
{
|
||||
// Reject damage that is not player initiated.
|
||||
if(%damageType == 7 || %damageType == 12 || %damageType == 14 || %damageType == 24 || %damageType == 25 || %damageType == 33 || %damageType == 35 || %damageType == 36 || %damageType == 98 || %damageType == 99)
|
||||
return;
|
||||
|
||||
// failsafe
|
||||
if(!isObject(%sourceObject) || %sourceObject $= "" || !isObject(%targetObject) || %targetObject $= "")
|
||||
return;
|
||||
|
||||
// don't count damage done to vehicles
|
||||
if(%targetObject.isMounted())
|
||||
return;
|
||||
|
||||
// Vehicle Impacts.
|
||||
if(%damageType == 13){ // run down by vehicle
|
||||
if(!(%attacker = %sourceObject.getControllingClient()) > 0){
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Turrets.
|
||||
else if(%sourceObject.getClassName() $= "Turret" || %sourceObject.getClassName() $= "VehicleTurret" || %sourceObject.getClassName() $= "FlyingVehicle" || %sourceObject.getClassName() $= "HoverVehicle"){
|
||||
// Controlled
|
||||
%attacker = %sourceObject.getControllingClient(); //is turret being controlled?
|
||||
if(%attacker == 0){ // Not controlled.
|
||||
// Owned
|
||||
if(isObject(%sourceObject.owner)){
|
||||
%attacker = %sourceObject.owner;
|
||||
}
|
||||
// Automated & no-owner.
|
||||
else{
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else { // Pretty much anything else.
|
||||
%attacker = %sourceObject.client;
|
||||
}
|
||||
|
||||
%victim = %targetObject.client;
|
||||
|
||||
// failsafe
|
||||
if(%attacker $= "" || %victim $= "" || %attacker $= %victim)
|
||||
return;
|
||||
|
||||
// check if it's a tk
|
||||
if(Game.numTeams > 1 && %attacker.team $= %victim.team)
|
||||
return;
|
||||
|
||||
// store the damage
|
||||
if($Host::ClassicStatsType == 2)
|
||||
{
|
||||
// Teratos: Going to add mine+disc as a category...
|
||||
// Teratos: Tracking only gets the second batch of damage, but we add 85% of that to make up for the first batch of damage (just a dumb estimate so damage numbers look realistic in post-game).
|
||||
if(%victim.mineDisc) {
|
||||
//$stats::weapon_damage[%attacker, 50] += %amount + (%amount * (%damageType == 11 ? 0.87 : 1.41)); // Mine accounts for more than disc.
|
||||
$stats::weapon_damage[%attacker, 50] += %amount + $stats::last_minedisc[%attacker];
|
||||
|
||||
if($stats::weapon_damage[%attacker, 50] > $stats::weap_table[50])
|
||||
{
|
||||
$stats::weap_table[50] = $stats::weapon_damage[%attacker, 50];
|
||||
$stats::client_weap_table[50] = getTaggedString(%attacker.name);
|
||||
}
|
||||
}
|
||||
$stats::last_minedisc[%attacker] = %amount; // Track the last amount of damage so we can add it to the mine+disc.
|
||||
// Teratos: END Mine+Disc Support.
|
||||
|
||||
$stats::weapon_damage[%attacker, %damageType] += %amount;
|
||||
|
||||
if($stats::weapon_damage[%attacker, %damageType] > $stats::weap_table[%damageType])
|
||||
{
|
||||
$stats::weap_table[%damageType] = $stats::weapon_damage[%attacker, %damageType];
|
||||
$stats::client_weap_table[%damageType] = getTaggedString(%attacker.name);
|
||||
}
|
||||
}
|
||||
|
||||
// is it a laser damage?
|
||||
if(%damageType == 6)
|
||||
{
|
||||
// i will consider only shots that have been fired with 60% of total energy
|
||||
if(%sourceObject.getEnergyLevel() / %sourceObject.getDataBlock().maxEnergy < 0.6)
|
||||
return;
|
||||
|
||||
%distance = mFloor(VectorDist(%position, %sourceObject.getWorldBoxCenter()));
|
||||
|
||||
// max distance for sniper (this is the only fix i could find)
|
||||
// if(%distance > 1000)
|
||||
// %distance = 1000;
|
||||
|
||||
// is it an headshot?
|
||||
if(%victim.headshot)
|
||||
{
|
||||
%attacker.hs++;
|
||||
|
||||
if( ( %attacker.showMA $= "" ) || ( %attacker.showMA == 1 ) )
|
||||
bottomPrint(%attacker, "HEADSHOT (" @ %attacker.hs @ ")! Distance is " @ %distance @ " meters.", 3);
|
||||
logEcho(%attacker.nameBase @" (pl "@%attacker.player@"/cl "@%attacker@") headshot ("@%distance@")");
|
||||
|
||||
if(%attacker.hs > $stats::snipe_counter)
|
||||
{
|
||||
$stats::snipe_counter = %attacker.hs;
|
||||
$stats::snipe_client = getTaggedString(%attacker.name);
|
||||
}
|
||||
if(%distance > $stats::snipe_maxdistance)
|
||||
{
|
||||
$stats::snipe_maxdistance = %distance;
|
||||
$stats::snipe_maxdistanceclient = getTaggedString(%attacker.name);
|
||||
}
|
||||
}
|
||||
else // no
|
||||
{
|
||||
if(%attacker.showMA $= "" || %attacker.showMA)
|
||||
bottomPrint(%attacker, "HIT! Distance is " @ %distance @ " meters.", 3);
|
||||
|
||||
if(%distance > $stats::snipe_maxdistance)
|
||||
{
|
||||
$stats::snipe_maxdistance = %distance;
|
||||
$stats::snipe_maxdistanceclient = getTaggedString(%attacker.name);
|
||||
}
|
||||
}
|
||||
|
||||
// this callback will allow players to autoscreenshot the shot
|
||||
messageClient(%attacker, 'MsgSnipeShot', "", %distance);
|
||||
}
|
||||
}
|
||||
|
||||
// handleKillStat(%clVictim, %clKiller, %damageType, %implement)
|
||||
// Info: Calcs: Kills, TeamKills, FC kills
|
||||
function handleKillStat(%game, %clVictim, %clKiller, %damageType, %implement, %damageLocation)
|
||||
{
|
||||
if(%damageType == 13) // is a roadkill
|
||||
%clKiller = %implement.getControllingClient();
|
||||
|
||||
|
||||
if ( !isObject( %clVictim ) || !isObject( %clKiller ) )
|
||||
return;
|
||||
|
||||
// failsafe
|
||||
if(%clKiller $= "" || %clVictim $= "" || %clKiller $= %clVictim)
|
||||
return;
|
||||
|
||||
// is it a tk?
|
||||
if(%game.numTeams > 1 && %clKiller.team $= %clVictim.team)
|
||||
{
|
||||
$stats::tk[%clKiller]++;
|
||||
|
||||
if($stats::tk[%clKiller] > $stats::tk_counter)
|
||||
{
|
||||
$stats::tk_counter = $stats::tk[%clKiller];
|
||||
$stats::tk_client = getTaggedString(%clKiller.name);
|
||||
}
|
||||
}
|
||||
else // no
|
||||
{
|
||||
if($Host::ClassicStatsType == 1)
|
||||
{
|
||||
$stats::weapon_kills[%clKiller, %damageType]++;
|
||||
|
||||
if($stats::weapon_kills[%clKiller, %damageType] > $stats::weap_table[%damageType])
|
||||
{
|
||||
$stats::weap_table[%damageType] = $stats::weapon_kills[%clKiller, %damageType];
|
||||
$stats::client_weap_table[%damageType] = getTaggedString(%clKiller.name);
|
||||
}
|
||||
}
|
||||
|
||||
// was the victim a fc?
|
||||
if(%clVictim.plyrDiedHoldingFlag)
|
||||
{
|
||||
$stats::fckiller[%clKiller]++;
|
||||
|
||||
if($stats::fckiller[%clKiller] > $stats::fckiller_counter)
|
||||
{
|
||||
$stats::fckiller_counter = $stats::fckiller[%clKiller];
|
||||
$stats::fckiller_client = getTaggedString(%clKiller.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// handleMAStat(%projectile, %targetObject, %position)
|
||||
// Info: MA detection
|
||||
function handleMAStat(%data, %projectile, %targetObject, %modifier, %position, %normal)
|
||||
{
|
||||
// failsafe
|
||||
if(!isObject(%targetObject) || %targetObject $= "")
|
||||
return;
|
||||
|
||||
// failsafe
|
||||
if(!isObject(%projectile.sourceObject) || %projectile.sourceObject $= "")
|
||||
return;
|
||||
|
||||
%victim = %targetObject.client;
|
||||
%killer = %projectile.sourceObject.client;
|
||||
|
||||
// // Altair's method
|
||||
// %distance = mFloor(VectorDist(%position, %projectile.sourceObject.getWorldBoxCenter()));
|
||||
|
||||
// // Evolution Method
|
||||
%distance = mFloor(VectorDist(%position, %projectile.initialPosition));
|
||||
|
||||
// failsafe
|
||||
if(%victim $= "" || %killer $= "")
|
||||
return;
|
||||
|
||||
%projectileType = %data.getName() !$= "TR2DiscProjectile" ? %data.getName() : "DiscProjectile";
|
||||
|
||||
// only disc, plasma, or blaster
|
||||
if(%projectileType !$= "DiscProjectile" && %projectileType !$= "PlasmaBolt" && %projectileType !$= "EnergyBolt")
|
||||
return;
|
||||
|
||||
// is it a tk?
|
||||
if(Game.numTeams > 1 && %killer.team $= %victim.team)
|
||||
return;
|
||||
|
||||
// Eolk - changes to MA code
|
||||
%position = %targetObject.getPosition();
|
||||
%raycast = containerRaycast(%position, vectorAdd(%position, "0 0 -10"), $TypeMasks::ForceFieldObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::PlayerObjectType | $TypeMasks::StaticObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::VehicleObjectType, %targetObject);
|
||||
if(!isObject(firstWord(%raycast))) // We've got something...
|
||||
{
|
||||
if(%projectileType $= "DiscProjectile")
|
||||
{
|
||||
%killer.midairs++;
|
||||
|
||||
if( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) )
|
||||
bottomPrint(%killer, "Midair Disk (" @ %killer.midairs @ ")! Distance is " @ %distance @ " meters.", 3);
|
||||
|
||||
// this callback will allow players to autoscreenshot the MA
|
||||
messageClient(%killer, 'MsgMidAir', "", %distance);
|
||||
logEcho(%killer.nameBase @" (pl "@%killer.player@"/cl "@%killer@") hit a midair disc shot ("@%distance@")");
|
||||
|
||||
if(%killer.midairs > $stats::ma_counter)
|
||||
{
|
||||
$stats::ma_counter = %killer.midairs;
|
||||
$stats::ma_client = getTaggedString(%killer.name);
|
||||
}
|
||||
|
||||
if(%distance > $stats::ma_maxdistance)
|
||||
{
|
||||
$stats::ma_maxdistance = %distance;
|
||||
$stats::ma_maxdistanceclient = getTaggedString(%killer.name);
|
||||
}
|
||||
}
|
||||
else if(%projectileType $= "PlasmaBolt")
|
||||
{
|
||||
%killer.PlaMA++;
|
||||
|
||||
if ( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) )
|
||||
bottomPrint(%killer, "Midair Plasma (" @ %killer.PlaMA @ ")! Distance is " @ %distance @ " meters.", 3);
|
||||
|
||||
// this callback will allow players to autoscreenshot the MA
|
||||
messageClient(%killer, 'MsgPlasmaMidAir', "", %distance);
|
||||
logEcho(%killer.nameBase @" (pl "@%killer.player@"/cl "@%killer@") hit a midair plasma shot ("@%distance@")");
|
||||
|
||||
if(%killer.PlaMA > $stats::PlaMA_counter)
|
||||
{
|
||||
$stats::PlaMA_counter = %killer.PlaMA;
|
||||
$stats::PlaMA_client = getTaggedString(%killer.name);
|
||||
}
|
||||
|
||||
if(%distance > $stats::PlaMA_maxdistance)
|
||||
{
|
||||
$stats::PlaMA_maxdistance = %distance;
|
||||
$stats::PlaMA_maxdistanceclient = getTaggedString(%killer.name);
|
||||
}
|
||||
}
|
||||
else if(%projectileType $= "EnergyBolt")
|
||||
{
|
||||
%killer.blaMA++;
|
||||
|
||||
if( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) )
|
||||
bottomPrint(%killer, "Midair Blaster (" @ %killer.blaMA @ ")! Distance is " @ %distance @ " meters.", 3);
|
||||
|
||||
// this callback will allow players to autoscreenshot the MA
|
||||
messageClient(%killer, 'MsgBlasterMidAir', "", %distance);
|
||||
logEcho(%killer.nameBase @" (pl "@%killer.player@"/cl "@%killer@") hit a midair blaster shot ("@%distance@")");
|
||||
|
||||
if(%killer.blaMA > $stats::BlaMA_counter)
|
||||
{
|
||||
$stats::BlaMA_counter = %killer.BlaMA;
|
||||
$stats::BlaMA_client = getTaggedString(%killer.name);
|
||||
}
|
||||
|
||||
if(%distance > $stats::BlaMA_maxdistance)
|
||||
{
|
||||
$stats::BlaMA_maxdistance = %distance;
|
||||
$stats::BlaMA_maxdistanceclient = getTaggedString(%killer.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// sendEvoDebriefing(%client)
|
||||
// Info: Send Evo stats to the debriefing page
|
||||
function sendEvoDebriefing(%client)
|
||||
{
|
||||
// Eolk - Remove redundant checks
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00>%1 - %2<spop>', $MissionDisplayName, $MissionTypeDisplayName);
|
||||
|
||||
if($stats::MaxGrabSpeed || $stats::grabs_counter || $stats::fckiller_counter || $stats::caps_counter || $stats::fastestCap)
|
||||
{
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>FLAG STATS<spop>');
|
||||
if($stats::fastestCap)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Fastest Cap</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip><spop>', $stats::fastcap_client, $stats::fastcap_time);
|
||||
if($stats::MaxGrabSpeed)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Flaming Ass</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2 Kph!</clip><spop>', $stats::Grabber, $stats::MaxGrabSpeed);
|
||||
if($stats::caps_counter)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Cap Mastah</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip><spop>', $stats::caps_client, $stats::caps_counter);
|
||||
if($stats::grabs_counter)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Grabz0r</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip><spop>', $stats::grabs_client, $stats::grabs_counter);
|
||||
if($stats::fckiller_counter)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> FC killer</clip><lmargin%%:30><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip><spop>', $stats::fckiller_client, $stats::fckiller_counter);
|
||||
}
|
||||
|
||||
if($stats::BlaMA_counter || $stats::ma_counter || $stats::PlaMA_counter)
|
||||
{
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>MID AIR<lmargin%%:30>CHAMPION<lmargin%%:60>DISTANCE<spop>');
|
||||
|
||||
if($stats::ma_counter)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Disk</clip><lmargin%%:30><clip%%:60> %1 (%2)</clip><lmargin%%:60><clip%%:60> %3 (%4 mt)</clip><spop>', $stats::ma_client, $stats::ma_counter, $stats::ma_maxdistanceclient, $stats::ma_maxdistance);
|
||||
if($stats::PlaMA_counter)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Plasma</clip><lmargin%%:30><clip%%:60> %1 (%2)</clip><lmargin%%:60><clip%%:60> %3 (%4 mt)</clip><spop>', $stats::PlaMA_client, $stats::PlaMA_counter, $stats::PlaMA_maxdistanceclient, $stats::PlaMA_maxdistance);
|
||||
if($stats::BlaMA_counter)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> Blaster</clip><lmargin%%:30><clip%%:60> %1 (%2)</clip><lmargin%%:60><clip%%:60> %3 (%4 mt)</clip><spop>', $stats::BlaMA_client, $stats::BlaMA_counter, $stats::BlaMA_maxdistanceclient, $stats::BlaMA_maxdistance);
|
||||
}
|
||||
|
||||
if($stats::snipe_counter)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>Headhunter<lmargin%%:30> %1 (%2)!<spop>', $stats::snipe_client, $stats::snipe_counter);
|
||||
|
||||
if($stats::snipe_maxdistance)
|
||||
{
|
||||
%x = $stats::snipe_counter ? "" : "\n";
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '%3<lmargin:0><spush><color:00dc00><font:univers condensed:18>Longest Snipeshot is %1 meters by %2<spop>', $stats::snipe_maxdistance, $stats::snipe_maxdistanceclient, %x);
|
||||
}
|
||||
|
||||
for(%damageType = 1; %damageType < 51; %damageType++)
|
||||
{
|
||||
if(%damageType == 7 || %damageType == 12 || (%damageType > 13 && %damageType < 21) || %damageType == 23 || %damageType == 24 || %damageType == 25) {
|
||||
continue;
|
||||
}
|
||||
if(%damageType > 31 && %damageType < 50) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if($stats::weap_table[%damageType] > 0)
|
||||
{
|
||||
if($Host::ClassicStatsType == 2)
|
||||
{
|
||||
if(!%message)
|
||||
{
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>TYPE<lmargin%%:30>PLAYER<lmargin%%:60>TOTAL DAMAGE<spop>');
|
||||
%message = 1;
|
||||
}
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> %1</clip><lmargin%%:30><clip%%:60> %2</clip><lmargin%%:60><clip%%:40> %3</clip><spop>', $weap_message[%damageType], $stats::client_weap_table[%damageType], mFormatFloat($stats::weap_table[%damageType], "%.2f"));
|
||||
}
|
||||
else if($Host::ClassicStatsType == 1)
|
||||
{
|
||||
if(!%message)
|
||||
{
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>TYPE<lmargin%%:30>PLAYER<lmargin%%:60>KILLS<spop>');
|
||||
%message = 1;
|
||||
}
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '<lmargin:0><spush><color:00dc00><clip%%:40><font:univers condensed:18> %1</clip><lmargin%%:30><clip%%:60> %2</clip><lmargin%%:60><clip%%:40> %3</clip><spop>', $weap_message[%damageType], $stats::client_weap_table[%damageType], $stats::weap_table[%damageType]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($stats::tk_counter)
|
||||
messageClient(%client, 'MsgDebriefAddLine', "", '\n<lmargin:0><spush><color:00dc00><font:univers condensed:18>And the best teamkiller award goes to... %1 (%2)!<spop>', $stats::tk_client, $stats::tk_counter);
|
||||
}
|
||||
|
|
@ -1,131 +0,0 @@
|
|||
// Get Random Maps Script
|
||||
//
|
||||
// Used by the Set Next Mission feature
|
||||
//
|
||||
// Random Set Next Mission maps
|
||||
// Runs for SetNextMisssion (Random) and Map Repetition Checker
|
||||
// Randomizes the maps available in the admin menu
|
||||
//
|
||||
|
||||
// This file is present
|
||||
$GetRandomMapsLoaded = true;
|
||||
|
||||
// getRandomMap - returns a random map without duplicates until all have been played.
|
||||
// Script BY: DarkTiger
|
||||
// set this to 1 to save rng list to continue where the server left off in case of server reset
|
||||
|
||||
$rngListSave = 1;
|
||||
$rngDebug = 1;//show echos for testing
|
||||
|
||||
function getRandomMap(){
|
||||
// builds valid map list to pick from
|
||||
for(%i = 0; %i < $HostMissionCount; %i++){
|
||||
%map = $HostMissionFile[%i];
|
||||
%FFA = $Host::MapFFA[%map, $CurrentMissionType];
|
||||
%Cycle =$Host::MapCycle[%map, $CurrentMissionType];
|
||||
%bot = $BotEnabled[%i];
|
||||
if(%FFA && %Cycle){
|
||||
if($Host::BotsEnabled){
|
||||
if(%bot)
|
||||
%map[%c++] = %map;
|
||||
}
|
||||
else{
|
||||
%map[%c++] = %map;
|
||||
}
|
||||
}
|
||||
}
|
||||
%rng = getRSGN(1,%c,$CurrentMissionType); // use gameType as the id
|
||||
if($rngDebug){error(%map[%rng] SPC %rng);}
|
||||
return %map[%rng];
|
||||
}
|
||||
|
||||
function getRSGN(%min,%max,%id){
|
||||
// This funciton is kind of like a random sequence generator but its done on the fly
|
||||
// returns you a unique random number every time until max is reached
|
||||
// id value is so it can be used in more then one place
|
||||
// the id value can be function name that its used in or a number
|
||||
// lastly it only for numbers between -1000 to 1000 see down below;
|
||||
|
||||
if($rngListSave && isFile("rngLists/" @ %id @ ".cs") && !$rngIsLoaded[%id]){
|
||||
exec("rngLists/" @ %id @ ".cs");
|
||||
$rngIsLoaded[%id] = 1;
|
||||
if($rngDebug){error("Loading Map RNG List =" SPC "rngLists/" @ %id @ ".cs");}
|
||||
}
|
||||
|
||||
if(%id $= ""){
|
||||
error("getRSG function call does not have an id value");
|
||||
return getRandom(%min,%max);
|
||||
}
|
||||
|
||||
%c = %min - 1; // skip counter
|
||||
if(((%max - %min) - ($rng::Count[%id] - 1)) < 1) // reset if we cycled though all possable
|
||||
{
|
||||
$rng::Count[%id] = 1; // we dont reset to 0 becuae of the last number used
|
||||
// change these numbers to expand range
|
||||
for(%a = %min; %a <= %max; %a++) // this resets a wide range incase min max change for what ever reasion
|
||||
{
|
||||
$rng::List[%id,%a] = 0; // reset number list back to 0
|
||||
}
|
||||
|
||||
$rng::List[%id,$rng::Last[%id]] = 1; // mark the last number used as in used after reset
|
||||
}
|
||||
|
||||
%rng = getRandom(%min,%max - $rng::Count[%id] ); // find random number - the total number we have done
|
||||
|
||||
for(%i = %min; %i <= %max; %i++) // loop cycle though all possable numbers
|
||||
{
|
||||
if($rng::List[%id,%i]) // skip over ones that we have all ready used
|
||||
{
|
||||
continue;
|
||||
}
|
||||
%c++; // skip counter
|
||||
|
||||
if(%rng == %c) // onces the skip counter matches the rng number we have landed on a valid number that we havent used yet
|
||||
{
|
||||
break; // kill the loop
|
||||
}
|
||||
}
|
||||
|
||||
$rng::List[%id,%i] = 1;// this marks said number as used
|
||||
$rng::Count[%id]++;// up are total used numbers
|
||||
$rng::Last[%id] = %i; // for when the list resets it wont pick the same number twice
|
||||
|
||||
if(%i > %max || %i < %min)
|
||||
{ // fail safe
|
||||
return %max;
|
||||
}
|
||||
if($rngListSave){
|
||||
export( "$rng::*", "rngLists/" @ %id @ ".cs", false );
|
||||
}
|
||||
return %i; // return the one we stoped on
|
||||
}
|
||||
|
||||
// Return random maps list for SetNextMission
|
||||
// Primarily used in admin menus
|
||||
function SetNextMapGetRandoms( %client )
|
||||
{
|
||||
%cyclecount = 1;
|
||||
for(%i = 0; %i < 8; %i++)
|
||||
{
|
||||
$SetNextMissionMapSlot[%cyclecount] = getRandomMap();
|
||||
%cyclecount++;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset SetNextMission every map change
|
||||
package ResetSetNextMission
|
||||
{
|
||||
|
||||
function DefaultGame::gameOver(%game)
|
||||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
//Reset SetNextMission Restore
|
||||
$SetNextMissionRestore = "";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(ResetSetNextMission))
|
||||
activatePackage(ResetSetNextMission);
|
||||
|
|
@ -1,119 +0,0 @@
|
|||
// Map Repetition Checker Script
|
||||
//
|
||||
// To help decrease the chances of a repeated map in the map rotation by correcting repeated maps thru script
|
||||
//
|
||||
// Runs at the beginning of every map change
|
||||
// Keeps track of maps played (Last [$MRC::PastMapsDepth] Maps)
|
||||
// If any are repeating it picks a new map
|
||||
//
|
||||
// $EvoCachedNextMission = "RoundTheMountain";
|
||||
// $EvoCachedNextMission = "Arrakis";
|
||||
// $EvoCachedNextMission = "RoundTheMountainLT";
|
||||
// $EvoCachedNextMission = "ArenaDomeDM";
|
||||
|
||||
// How many previous maps you want to compare TheNextCached Map to
|
||||
$MRC::PastMapsDepth = 6;
|
||||
|
||||
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
|
||||
{
|
||||
$MRC::PrevMap[%x] = "";
|
||||
//echo("PM" @ %x @ ": " @ $MRC::PrevMap[%x]);
|
||||
}
|
||||
|
||||
//Ran in MissionTypeOptions.cs
|
||||
function MapRepetitionChecker( %game )
|
||||
{
|
||||
//Debug
|
||||
//%MapRepetitionCheckerDebug = true;
|
||||
|
||||
if(isEventPending($MapRepetitionSchedule))
|
||||
cancel($MapRepetitionSchedule);
|
||||
|
||||
//Make sure GetRandomMaps.cs is present
|
||||
if(!$GetRandomMapsLoaded)
|
||||
return;
|
||||
|
||||
if($EvoCachedNextMission $= "")
|
||||
return;
|
||||
|
||||
if(!$Host::TournamentMode && $Host::EnableMapRepetitionChecker)
|
||||
{
|
||||
//Do work
|
||||
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
|
||||
{
|
||||
if( $MRC::PrevMap[%x] !$= "" && $MRC::PrevMap[%x] $= $EvoCachedNextMission || $CurrentMission $= $EvoCachedNextMission )
|
||||
MapRepetitionCheckerFindRandom();
|
||||
}
|
||||
|
||||
//Set vars
|
||||
for(%x = $MRC::PastMapsDepth; %x >= 1; %x = %x - 1)
|
||||
{
|
||||
if(%x > 1)
|
||||
{
|
||||
if($MRC::PrevMap[%x - 1] !$= "")
|
||||
$MRC::PrevMap[%x] = $MRC::PrevMap[%x - 1];
|
||||
}
|
||||
else if(%x $= 1)
|
||||
$MRC::PrevMap[%x] = $CurrentMission;
|
||||
}
|
||||
|
||||
//Debug
|
||||
if(%MapRepetitionCheckerDebug)
|
||||
{
|
||||
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
|
||||
{
|
||||
if( $MRC::PrevMap[%x] !$= "" )
|
||||
echo("PM" @ %x @ ": " @ $MRC::PrevMap[%x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function MapRepetitionCheckerFindRandom(%redone)
|
||||
{
|
||||
//Make sure GetRandomMaps.cs is present
|
||||
if(!$GetRandomMapsLoaded)
|
||||
return;
|
||||
|
||||
//Backup
|
||||
if(%redone $="")
|
||||
$SetNextMissionRestore = $EvoCachedNextMission;
|
||||
|
||||
//Do work
|
||||
//getRandomMap() is in GetRandomMaps.cs
|
||||
$EvoCachedNextMission = getRandomMap();
|
||||
|
||||
//Make sure new map still complies
|
||||
%redo = 0;
|
||||
for(%x = 1; %x <= $MRC::PastMapsDepth; %x++)
|
||||
{
|
||||
if($MRC::PrevMap[%x] !$= "" && $MRC::PrevMap[%x] $= $EvoCachedNextMission)
|
||||
%redo = 1;
|
||||
}
|
||||
|
||||
//Make sure its within maplimits
|
||||
%newmaplimits = $Host::MapPlayerLimits[$EvoCachedNextMission, $CurrentMissionType];
|
||||
%min = getWord(%newmaplimits,0);
|
||||
%max = getWord(%newmaplimits,1);
|
||||
if((%min > $AllPlayerCount || $AllPlayerCount > %max) && $AllPlayerCount > 2 )
|
||||
%redo = 1;
|
||||
|
||||
if( %redo && %redone < 3 )
|
||||
{
|
||||
%redone++;
|
||||
MapRepetitionCheckerFindRandom(%redone);
|
||||
}
|
||||
else
|
||||
{
|
||||
error(formatTimeString("HH:nn:ss") SPC "Map Repetition Corrected from" SPC $SetNextMissionRestore SPC "to" SPC $EvoCachedNextMission @ "." );
|
||||
|
||||
//Admin Message Only
|
||||
for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%idx);
|
||||
|
||||
if(%cl.isAdmin)
|
||||
messageClient(%cl, 'MsgMapRepCorrection', '\crMap Repetition Corrected: Next mission set from %1 to %2.', $SetNextMissionRestore, $EvoCachedNextMission);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -43,21 +43,11 @@ function loadMissionStage2()
|
|||
$Host::HiVisibility = "0"; //always SPEED
|
||||
}
|
||||
|
||||
if(isEventPending($MapRepetitionSchedule))
|
||||
cancel($MapRepetitionSchedule);
|
||||
|
||||
//Start MapRepetitionChecker
|
||||
$MapRepetitionSchedule = schedule(20000, 0, "MapRepetitionChecker", %game);
|
||||
|
||||
//Siege NoBaseRape Fix
|
||||
if( $CurrentMissionType $= "Siege" )
|
||||
$Host::EvoNoBaseRapeEnabled = 0;
|
||||
$Host::NoBaseRapeEnabled = 0;
|
||||
else
|
||||
$Host::EvoNoBaseRapeEnabled = 1;
|
||||
|
||||
//Fix for Lak to CTF transition (Uneven Teams)
|
||||
if(Game.numTeams > 1 && ($TeamRank[1, count] > $TeamRank[2, count] + 2) && $previousMissionType $= "LakRabbit")
|
||||
Game.setupClientTeams();
|
||||
$Host::NoBaseRapeEnabled = 1;
|
||||
|
||||
parent::loadMissionStage2();
|
||||
}
|
||||
|
|
|
|||
42
Classic/scripts/autoexec/NoBaseRape.cs
Normal file
42
Classic/scripts/autoexec/NoBaseRape.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package NoBaseRape
|
||||
{
|
||||
|
||||
//From Evolution MOD
|
||||
//Modified for our needs
|
||||
function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType)
|
||||
{
|
||||
//echo( %targetObject.getDataBlock().getClassName() );
|
||||
//echo( %targetObject.getDataBlock().getName() );
|
||||
|
||||
%targetname = %targetObject.getDataBlock().getName();
|
||||
|
||||
//Used on some maps to make invs invincible
|
||||
if( $CurrentMission $= "SmallCrossing" || $CurrentMission $= "Bulwark")
|
||||
{
|
||||
if( %targetObject.invincible && %targetname $= "StationInventory" )
|
||||
{
|
||||
//NBRAssetSound( %game, %sourceObject );
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if(!$Host::TournamentMode && $Host::NoBaseRapeEnabled && $Host::NoBaseRapePlayerCount > $TotalTeamPlayerCount)
|
||||
{
|
||||
if( %targetname $= "GeneratorLarge" || %targetname $= "StationInventory" || %targetname $= "SolarPanel" )
|
||||
{
|
||||
//Notify only if asset is on other team
|
||||
if( %targetObject.team !$= %sourceObject.team )
|
||||
{
|
||||
NBRAssetSound( %game, %sourceObject );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(NoBaseRape))
|
||||
activatePackage(NoBaseRape);
|
||||
|
|
@ -9,10 +9,10 @@
|
|||
// Called in GetTeamCounts.cs
|
||||
function NBRStatusNotify( %game )
|
||||
{
|
||||
if( $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::EvoNoBaseRapeEnabled )
|
||||
if( $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::NoBaseRapeEnabled )
|
||||
{
|
||||
//On
|
||||
if( $Host::EvoNoBaseRapeClassicPlayerCount > $TotalTeamPlayerCount )
|
||||
if( $Host::NoBaseRapePlayerCount > $TotalTeamPlayerCount )
|
||||
{
|
||||
if( $NBRStatus !$= "PLAYEDON" )
|
||||
$NBRStatus = "ON";
|
||||
|
|
@ -64,9 +64,9 @@ if (!isActivePackage(ResetNBRNotify))
|
|||
function NBRAssetSound( %game, %sourceObject )
|
||||
{
|
||||
//Wont play again until the schedule is done
|
||||
if(!isEventPending(%sourceObject.NBRAssetSoundSchedule) && $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::EvoNoBaseRapeEnabled )
|
||||
if(!isEventPending(%sourceObject.NBRAssetSoundSchedule) && $CurrentMissionType $= "CTF" && $Host::EnableNoBaseRapeNotify && !$Host::TournamentMode && $Host::NoBaseRapeEnabled )
|
||||
{
|
||||
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '\c2No Base Rape is enabled until %1 players.', $Host::EvoNoBaseRapeClassicPlayerCount );
|
||||
messageClient(%sourceObject.client, 'MsgNoBaseRapeNotify', '\c2No Base Rape is enabled until %1 players.', $Host::NoBaseRapePlayerCount );
|
||||
%sourceObject.NBRAssetSoundSchedule = schedule(10000, 0, "ResetNBRAssetSound", %sourceObject );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
265
Classic/scripts/autoexec/ObserveFlag.cs
Normal file
265
Classic/scripts/autoexec/ObserveFlag.cs
Normal file
|
|
@ -0,0 +1,265 @@
|
|||
package PizzaThings
|
||||
{
|
||||
|
||||
// function OptionsDlg::onWake(%this)
|
||||
// {
|
||||
// if(!$observeFlagBind)
|
||||
// {
|
||||
// $ObsRemapName[$ObsRemapCount] = "Obs First Flag";
|
||||
// $ObsRemapCmd[$ObsRemapCount] = "observeFirstFlag";
|
||||
// $ObsRemapCount++;
|
||||
// $ObsRemapName[$ObsRemapCount] = "Obs Second Flag";
|
||||
// $ObsRemapCmd[$ObsRemapCount] = "observeSecondFlag";
|
||||
// $ObsRemapCount++;
|
||||
|
||||
// $observeFlagBind = true;
|
||||
// }
|
||||
|
||||
// parent::onWake(%this);
|
||||
// }
|
||||
|
||||
// For Observe Flag
|
||||
// From Evo
|
||||
function Observer::onTrigger(%data, %obj, %trigger, %state)
|
||||
{
|
||||
if (%state == 0 || %trigger > 5)
|
||||
return;
|
||||
|
||||
//first, give the game the opportunity to prevent the observer action
|
||||
if (!Game.ObserverOnTrigger(%data, %obj, %trigger, %state))
|
||||
return;
|
||||
|
||||
%client = %obj.getControllingClient();
|
||||
if (%client == 0)
|
||||
return;
|
||||
|
||||
switch$(%obj.mode)
|
||||
{
|
||||
case "followFlag":
|
||||
if(!%client.observingFlag)
|
||||
return;
|
||||
|
||||
if(%trigger == 0) // press FIRE, switch to the other flag
|
||||
{
|
||||
if(%client.flagObserved == $TeamFlag[1])
|
||||
{
|
||||
%otherFlag = $TeamFlag[2];
|
||||
%otherFlagTeam = 2;
|
||||
}
|
||||
else if(%client.flagObserved == $TeamFlag[2])
|
||||
{
|
||||
%otherFlag = $TeamFlag[1];
|
||||
%otherFlagTeam = 1;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
// the flag isn't carried
|
||||
if(%otherFlag.carrier $= "")
|
||||
observeFlag(%client, %otherFlag, 1, %otherFlagTeam);
|
||||
else if(isObject(%otherFlag.carrier.client))
|
||||
observeFlag(%client, %otherFlag.carrier.client, 2, %otherFlagTeam);
|
||||
}
|
||||
else if(%trigger == 3) // press JET, switch to the other flag
|
||||
{
|
||||
if(%client.flagObserved == $TeamFlag[1])
|
||||
{
|
||||
%otherFlag = $TeamFlag[2];
|
||||
%otherFlagTeam = 2;
|
||||
}
|
||||
else if(%client.flagObserved == $TeamFlag[2])
|
||||
{
|
||||
%otherFlag = $TeamFlag[1];
|
||||
%otherFlagTeam = 1;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
// the flag isn't carried
|
||||
if(%otherFlag.carrier $= "")
|
||||
observeFlag(%client, %otherFlag, 1, %otherFlagTeam);
|
||||
else if(isObject(%otherFlag.carrier.client))
|
||||
observeFlag(%client, %otherFlag.carrier.client, 2, %otherFlagTeam);
|
||||
}
|
||||
else if(%trigger == 2) //press JUMP, stop observing flag
|
||||
{
|
||||
if(%client.observeClient != -1)
|
||||
{
|
||||
observerFollowUpdate(%client, -1, false);
|
||||
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
||||
%client.observeClient = -1;
|
||||
}
|
||||
%obj.mode = "observerFly";
|
||||
%obj.setFlyMode();
|
||||
updateObserverFlyHud(%client);
|
||||
%client.observingFlag = false;
|
||||
%client.flagObserved = "";
|
||||
%client.flagObsTeam = "";
|
||||
}
|
||||
|
||||
default:
|
||||
Parent::onTrigger(%data, %obj, %trigger, %state);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(PizzaThings))
|
||||
activatePackage(PizzaThings);
|
||||
|
||||
function serverCmdObserveFirstFlag(%client)
|
||||
{
|
||||
// works only for CTF
|
||||
if(Game.class !$= CTFGame)
|
||||
return;
|
||||
|
||||
// client must be an observer
|
||||
if(%client.team > 0)
|
||||
return;
|
||||
|
||||
// check if the flag is carried by someone
|
||||
%player = $TeamFlag[1].carrier;
|
||||
|
||||
if($TeamFlag[1].isHome || %player $= "")
|
||||
observeFlag(%client, $TeamFlag[1], 1, 1);
|
||||
else
|
||||
observeFlag(%client, %player.client, 2, 1);
|
||||
}
|
||||
|
||||
function serverCmdObserveSecondFlag(%client)
|
||||
{
|
||||
// works only for CTF
|
||||
if(Game.class !$= CTFGame)
|
||||
return;
|
||||
|
||||
// client must be an observer
|
||||
if(%client.team > 0)
|
||||
return;
|
||||
|
||||
// check if the flag is carried by someone
|
||||
%player = $TeamFlag[2].carrier;
|
||||
|
||||
if($TeamFlag[2].isHome || %player $= "")
|
||||
observeFlag(%client, $TeamFlag[2], 1, 2);
|
||||
else
|
||||
observeFlag(%client, %player.client, 2, 2);
|
||||
}
|
||||
|
||||
function observeFlag(%client, %target, %type, %flagTeam)
|
||||
{
|
||||
if(!isObject(%client) || !isObject(%target) || !isObject(%client.camera))
|
||||
return;
|
||||
|
||||
if(Game.class !$= CTFGame)
|
||||
return;
|
||||
|
||||
if(%client.team > 0)
|
||||
return;
|
||||
|
||||
// cancel any scheduled update
|
||||
if(isEventPending(%client.obsHudSchedule))
|
||||
cancel(%client.obsHudSchedule);
|
||||
|
||||
// must be an observer when observing other clients
|
||||
if(%client.getControlObject() != %client.camera)
|
||||
return;
|
||||
|
||||
//can't observer yourself
|
||||
if(%client == %target)
|
||||
return;
|
||||
|
||||
%count = ClientGroup.getCount();
|
||||
|
||||
//can't go into observer mode if you're the only client
|
||||
if(%count <= 1 && %type != 1)
|
||||
return;
|
||||
|
||||
if(%type == 1) // Flag
|
||||
{
|
||||
if(isObject(%client.player))
|
||||
%client.player.scriptKill(0); // the player is still playing (this shouldn't be happen)
|
||||
|
||||
%client.camera.getDataBlock().setMode(%client.camera, "followFlag", $TeamFlag[%flagTeam]);
|
||||
%client.setControlObject(%client.camera);
|
||||
clearBottomPrint(%client);
|
||||
|
||||
// was the client observing a player before?
|
||||
if(%client.observeClient != -1)
|
||||
{
|
||||
observerFollowUpdate(%client, -1, false);
|
||||
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
||||
%client.observeClient = -1;
|
||||
}
|
||||
}
|
||||
else // Player
|
||||
{
|
||||
// make sure the target actually exists
|
||||
if(%target > 0)
|
||||
{
|
||||
%found = false;
|
||||
for(%i = 0; %i < %count; %i++)
|
||||
{
|
||||
if(ClientGroup.getObject(%i) == %target)
|
||||
{
|
||||
%found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!%found)
|
||||
return;
|
||||
}
|
||||
|
||||
if(isObject(%client.player))
|
||||
%client.player.scriptKill(0); // the player is still playing (this shouldn't be happen)
|
||||
|
||||
observerFollowUpdate(%client, %target, true);
|
||||
displayObserverHud(%client, %target);
|
||||
messageClient(%target, 'Observer', '\c1%1 is now observing you.', %client.name);
|
||||
|
||||
// was the client observing a player before?
|
||||
if(%client.observeClient != -1)
|
||||
messageClient(%client.observeClient, 'ObserverEnd', '\c1%1 is no longer observing you.', %client.name);
|
||||
%client.camera.getDataBlock().setMode(%client.camera, "observerFollow", %target.player);
|
||||
%client.setControlObject(%client.camera);
|
||||
%client.observeClient = %target;
|
||||
}
|
||||
|
||||
//clear the observer fly mode var...
|
||||
%client.observeFlyClient = -1;
|
||||
%client.observingFlag = true;
|
||||
%client.flagObserved = $TeamFlag[%flagTeam];
|
||||
%client.flagObsTeam = %flagTeam;
|
||||
}
|
||||
|
||||
// function observeFirstFlag()
|
||||
// {
|
||||
// commandToServer('ObserveFirstFlag');
|
||||
// }
|
||||
|
||||
// function observeSecondFlag()
|
||||
// {
|
||||
// commandToServer('ObserveSecondFlag');
|
||||
// }
|
||||
|
||||
// function sendPizzaHudUpdate(%game, %client, %msg)
|
||||
// {
|
||||
// %pizzaOptMask = 0;
|
||||
// if($RandomTeams == 1) %pizzaOptMask += 1;
|
||||
// if($Host::ClassicFairTeams == 1) %pizzaOptMask += 2;
|
||||
// if($Host::ClassicAutoPWEnabled == 1) %pizzaOptMask += 4;
|
||||
// if($Host::EvoFullServerPWEnabled == 1) %pizzaOptMask += 8;
|
||||
// if($Host::EvoNoBaseRapeEnabled == 1) %pizzaOptMask += 16;
|
||||
// if($PizzaHudRestartVar == 1) %pizzaOptMask += 32;
|
||||
// messageClient(%client, 'UpdatePizzaHud', %msg, %pizzaOptMask, %client.isAdmin + %client.isSuperAdmin);
|
||||
// }
|
||||
|
||||
// function serverCmdRegisterPizzaClient(%client)
|
||||
// {
|
||||
// if(!%client.pizza)
|
||||
// {
|
||||
// %client.pizza = true;
|
||||
// %msg = "\c2Pizza Client registered.";
|
||||
// sendPizzaHudUpdate(%game, %client, %msg);
|
||||
// }
|
||||
// }
|
||||
|
|
@ -103,22 +103,6 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
|||
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||
}
|
||||
|
||||
//Admin Next Mission Message at beginning of matches
|
||||
function DefaultGame::startMatch(%game)
|
||||
{
|
||||
Parent::startMatch(%game);
|
||||
|
||||
for(%idx = 0; %idx < ClientGroup.getCount(); %idx++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%idx);
|
||||
|
||||
if(%cl.isAdmin)
|
||||
{
|
||||
messageClient( %cl, 'MsgNotifyEvoNextMission', '\crNext Mission: %1', $EvoCachedNextMission);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// Called in GetTeamCounts.cs
|
||||
function TeamBalanceNotify( %game, %team1difference, %team2difference )
|
||||
{
|
||||
if( ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "sctf") && $TotalTeamPlayerCount !$= 0 && !$Host::TournamentMode )
|
||||
if( Game.numTeams > 1 && $TotalTeamPlayerCount !$= 0 && !$Host::TournamentMode )
|
||||
{
|
||||
//echo ("%Team1Difference " @ %Team1Difference);
|
||||
//echo ("%Team2Difference " @ %Team2Difference);
|
||||
|
|
|
|||
1572
Classic/scripts/autoexec/VoteMenu.cs
Normal file
1572
Classic/scripts/autoexec/VoteMenu.cs
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -20,8 +20,8 @@ function VoteSound( %game, %typename, %arg1, %arg2, %VoteSoundRandom )
|
|||
messageAll('', '\c1Vote in Progress: \c0To change the mission to %1 (%2). %3~wgui/objective_notification.wav', %arg1, %arg2, %votemsg );
|
||||
echo("Vote in Progress: To change the mission to" SPC %arg1 SPC "(" @ %arg2 @ ").");
|
||||
case "VoteSkipMission":
|
||||
messageAll('', '\c1Vote in Progress: \c0To skip the mission to %1. %2~wgui/objective_notification.wav', $EvoCachedNextMission, %votemsg );
|
||||
echo("Vote in Progress: To skip the mission to" SPC $EvoCachedNextMission @ ".");
|
||||
messageAll('', '\c1Vote in Progress: \c0To skip the mission. %1~wgui/objective_notification.wav', %votemsg );
|
||||
echo("Vote in Progress: To skip the mission.");
|
||||
case "VoteChangeTimeLimit":
|
||||
if(%arg1 $= "999") %arg1 = "unlimited";
|
||||
messageAll('', '\c1Vote in Progress: \c0To change the time limit to %1. %2~wgui/objective_notification.wav', %arg1, %votemsg );
|
||||
|
|
@ -47,11 +47,14 @@ function VoteSound( %game, %typename, %arg1, %arg2, %VoteSoundRandom )
|
|||
}
|
||||
}
|
||||
else //Is observer
|
||||
messageAll('', '\c1Vote in Progress: \c0To kick player %1. %3~wgui/objective_notification.wav', %arg1.name, %votemsg );
|
||||
echo("Vote in Progress: To kick player" SPC %arg1.name @ ".");
|
||||
messageAll('', '\c1Vote in Progress: \c0To kick player %1. %2~wgui/objective_notification.wav', %arg1.nameBase, %votemsg );
|
||||
echo("Vote in Progress: To kick player" SPC %arg1.nameBase SPC "(" @ %arg1.guid @ ").");
|
||||
case "VoteTournamentMode":
|
||||
messageAll('', '\c1Vote in Progress: \c0To change the mission to Tournament Mode (%1). %3~wgui/objective_notification.wav', %arg1, %arg2, %votemsg );
|
||||
echo("Vote in Progress: To change the mission to Tournament Mode" SPC "(" @ %arg1 @ ").");
|
||||
default:
|
||||
messageAll('', '\c1Vote in Progress: \c0To %1. %2~wgui/objective_notification.wav', %arg1, %votemsg );
|
||||
echo("Vote in Progress: To" SPC %arg1);
|
||||
}
|
||||
|
||||
if(isEventPending($VoteSoundSchedule))
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
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 TourneyNetClient2 to play.\n Download it from t2discord.tk and drop it into your GameData/Base folder.", 10, 3);
|
||||
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 TourneyNetClient2 to play.\n Download it from playt2.com and drop it into your GameData/Base folder.", 10, 3);
|
||||
}
|
||||
|
||||
package checkver
|
||||
|
|
|
|||
|
|
@ -1236,7 +1236,7 @@ package dtStats{
|
|||
parent::missionLoadDone(%game);
|
||||
//check to see if we are running evo or not, if not then lets just enable these
|
||||
if(!isFile("scripts/autoexec/evolution.cs")){
|
||||
$Host::EvoAveragePings = $Host::ShowIngamePlayerScores = 1;
|
||||
$Host::AveragePings = $Host::ShowIngamePlayerScores = 1;
|
||||
}
|
||||
}
|
||||
function serverCmdShowHud(%client, %tag){ // to refresh screen when client opens it up
|
||||
|
|
@ -2503,7 +2503,7 @@ function LakRabbitHud(%game, %client, %tag){
|
|||
$TeamRank[2, count] = 0;
|
||||
}
|
||||
|
||||
if ( $Host::EvoAveragePings )
|
||||
if ( $Host::AveragePings )
|
||||
{
|
||||
for ( %count = 0; %count <= Game.numteams; %count++ )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ function ALTsendModInfoToClient(%client)
|
|||
|
||||
if($Host::TimeLimit $= "999" || $Host::TimeLimit $= "unlimited") %timeloadingvar = "Unlimited"; else %timeloadingvar = $Host::TimeLimit;
|
||||
|
||||
if($Host::EvoKickObservers $= 0) %obskickvar = "Off"; else %obskickvar = ($Host::EvoKickObservers / 60) @ " Minutes";
|
||||
if($Host::KickObserverTimeout $= 0) %obskickvar = "Off"; else %obskickvar = ($Host::KickObserverTimeout / 60) @ " Minutes";
|
||||
|
||||
%time = "<color:" @ $Host::LoadScreenColor1 @ ">Time limit: <color:" @ $Host::LoadScreenColor2 @ ">" @ %timeloadingvar;
|
||||
%max = "<color:" @ $Host::LoadScreenColor1 @ ">Max players: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::MaxPlayers;
|
||||
|
|
@ -183,30 +183,14 @@ function ALTsendModInfoToClient(%client)
|
|||
//%crc = "<color:" @ $Host::LoadScreenColor1 @ ">CRC checking: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::CRCTextures ? "On" : "Off");
|
||||
//%pure = "<color:" @ $Host::LoadScreenColor1 @ ">Pure server: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::PureServer ? "On" : "Off");
|
||||
|
||||
if($Host::EvoNoBaseRapeEnabled)
|
||||
%rapeppl = "<color:" @ $Host::LoadScreenColor1 @ ">Min No Base Rape: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::EvoNoBaseRapeClassicPlayerCount;
|
||||
if($Host::NoBaseRapeEnabled)
|
||||
%rapeppl = "<color:" @ $Host::LoadScreenColor1 @ ">Min No Base Rape: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::NoBaseRapePlayerCount;
|
||||
|
||||
%turrets = "<color:" @ $Host::LoadScreenColor1 @ ">Min Turrets: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::EnableTurretPlayerCount;
|
||||
|
||||
if($Host::EvoStats && (!$Host::TournamentMode || ($Host::TournamentMode && $Host::EvoStatsTourney)) && $Host::EvoStatsType != 0)
|
||||
%stats = "<color:" @ $Host::LoadScreenColor1 @ ">Stats based on: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::EvoStatsType == 1 ? "Kills" : "Damage");
|
||||
if($Host::ClassicEvoStats && $Host::ClassicStatsType > 0)
|
||||
%stats = "<color:" @ $Host::LoadScreenColor1 @ ">Stats based on: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::ClassicStatsType == 1 ? "Kills" : "Damage");
|
||||
|
||||
if($Evo::ETMMode && $ETMmode::CurrentMap <= $ETMmode::Counter)
|
||||
{
|
||||
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $ETMmode::MapDisplayName[$ETMmode::CurrentMap];
|
||||
}
|
||||
else
|
||||
{
|
||||
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ findNextCycleMission();
|
||||
if ( $Host::ClassicRandomMissions )
|
||||
{
|
||||
%nmis = %nmis SPC "(Random)";
|
||||
}
|
||||
if($Host::EvoTourneySameMap && $Host::TournamentMode)
|
||||
{
|
||||
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $CurrentMission @ " (Same)";
|
||||
}
|
||||
}
|
||||
|
||||
%currentmis = "<color:" @ $Host::LoadScreenColor1 @ ">Current mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $MissionDisplayName @ " (" @ $MissionTypeDisplayName @ ")";
|
||||
|
||||
|
|
@ -300,7 +284,7 @@ function ALTsendModInfoToClient(%client)
|
|||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %turrets;
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %obskick;
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %stats;
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %nmis;
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = "<lmargin:24><Font:univers:18><bitmap:bullet_2>" @ %currentmis;
|
||||
$dtLoadingScreen::LoadScreenMessage[$dmlP++] = " ";
|
||||
|
||||
//$dtLoadingScreen::LoadScreenMessage[$dmlP++] = %rape;
|
||||
|
|
@ -396,30 +380,30 @@ function NORMALsendModInfoToClient(%client)
|
|||
//%pure = "<color:" @ $Host::LoadScreenColor1 @ ">Pure server: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::PureServer ? "On" : "Off");
|
||||
|
||||
|
||||
if($Host::EvoNoBaseRapeEnabled)
|
||||
%rapeppl = "<color:" @ $Host::LoadScreenColor1 @ ">Min No Base Rape: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::EvoNoBaseRapeClassicPlayerCount;
|
||||
if($Host::NoBaseRapeEnabled)
|
||||
%rapeppl = "<color:" @ $Host::LoadScreenColor1 @ ">Min No Base Rape: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::NoBaseRapePlayerCount;
|
||||
|
||||
%turrets = "<color:" @ $Host::LoadScreenColor1 @ ">Min Turrets: <color:" @ $Host::LoadScreenColor2 @ ">" @ $Host::EnableTurretPlayerCount;
|
||||
|
||||
if($Host::EvoStats && (!$Host::TournamentMode || ($Host::TournamentMode && $Host::EvoStatsTourney)) && $Host::EvoStatsType != 0)
|
||||
%stats = "<color:" @ $Host::LoadScreenColor1 @ ">Stats based on: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::EvoStatsType == 1 ? "Kills" : "Damage");
|
||||
if($Host::ClassicEvoStats && $Host::ClassicStatsType > 0)
|
||||
%stats = "<color:" @ $Host::LoadScreenColor1 @ ">Stats based on: <color:" @ $Host::LoadScreenColor2 @ ">" @ ($Host::ClassicStatsType == 1 ? "Kills" : "Damage");
|
||||
|
||||
if($Evo::ETMMode && $ETMmode::CurrentMap <= $ETMmode::Counter)
|
||||
{
|
||||
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $ETMmode::MapDisplayName[$ETMmode::CurrentMap];
|
||||
}
|
||||
else
|
||||
{
|
||||
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ findNextCycleMission();
|
||||
if ( $Host::ClassicRandomMissions )
|
||||
{
|
||||
%nmis = %nmis SPC "(Random)";
|
||||
}
|
||||
if($Host::EvoTourneySameMap && $Host::TournamentMode)
|
||||
{
|
||||
%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $CurrentMission @ " (Same)";
|
||||
}
|
||||
}
|
||||
//if($Evo::ETMMode && $ETMmode::CurrentMap <= $ETMmode::Counter)
|
||||
//{
|
||||
// %nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $ETMmode::MapDisplayName[$ETMmode::CurrentMap];
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
//%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ findNextCycleMission();
|
||||
//if ( $Host::ClassicRandomMissions )
|
||||
//{
|
||||
//%nmis = %nmis SPC "(Random)";
|
||||
//}
|
||||
//if($Host::EvoTourneySameMap && $Host::TournamentMode)
|
||||
//{
|
||||
//%nmis = "<color:" @ $Host::LoadScreenColor1 @ ">Next mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $CurrentMission @ " (Same)";
|
||||
//}
|
||||
//}
|
||||
|
||||
%currentmis = "<color:" @ $Host::LoadScreenColor1 @ ">Current mission: <color:" @ $Host::LoadScreenColor2 @ ">" @ $MissionDisplayName @ " (" @ $MissionTypeDisplayName @ ")";
|
||||
|
||||
|
|
@ -449,7 +433,7 @@ function NORMALsendModInfoToClient(%client)
|
|||
%ServerTextLine[4] = %rapeppl;
|
||||
%ServerTextLine[5] = %turrets;
|
||||
%ServerTextLine[6] = %stats;
|
||||
%ServerTextLine[7] = %nmis;
|
||||
%ServerTextLine[7] = %currentmis;
|
||||
|
||||
//%serverTextLine[2] = %td;
|
||||
//%serverTextLine[3] = %crc;
|
||||
|
|
|
|||
196
Classic/scripts/autoexec/zMineDisc.cs
Normal file
196
Classic/scripts/autoexec/zMineDisc.cs
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
//**********************************************************
|
||||
// CREDITS
|
||||
//
|
||||
// Eolks - I think he wrote most (probably all) of the mine+disc support.
|
||||
//**********************************************************
|
||||
|
||||
$DamageTypeText[50] = 'Mine+Disc'; // Teratos: Pseudo-damage type
|
||||
|
||||
// Eolk - Mine disc messages // Teratos - betterized.
|
||||
$DeathMessageMineDiscCount = 4;
|
||||
$DeathMessageMineDisc[0] = '\c0%4 kills %1 with a mine+disc.';
|
||||
$DeathMessageMineDisc[1] = '\c0%4 unleashes a world of hurt on %1 with a mine+disc.';
|
||||
$DeathMessageMineDisc[2] = '\c0%4 shows %1 the power of a spinfusor+mine combo!';
|
||||
$DeathMessageMineDisc[3] = '\c0%1 never saw that mine+disc coming from %4.';
|
||||
|
||||
// Teratos: Guessing this was Eolk?
|
||||
function resetMineDiscCheck(%cl)
|
||||
{
|
||||
%cl.minediscCheck = 0;
|
||||
}
|
||||
|
||||
package StatsMineDisc
|
||||
{
|
||||
function DefaultGame::displayDeathMessages(%game, %clVictim, %clKiller, %damageType, %implement)
|
||||
{
|
||||
// ----------------------------------------------------------------------------------
|
||||
// z0dd - ZOD, 6/18/02. From Panama Jack, send the damageTypeText as the last varible
|
||||
// in each death message so client knows what weapon it was that killed them.
|
||||
|
||||
%victimGender = (%clVictim.sex $= "Male" ? 'him' : 'her');
|
||||
%victimPoss = (%clVictim.sex $= "Male" ? 'his' : 'her');
|
||||
%killerGender = (%clKiller.sex $= "Male" ? 'him' : 'her');
|
||||
%killerPoss = (%clKiller.sex $= "Male" ? 'his' : 'her');
|
||||
%victimName = %clVictim.name;
|
||||
%killerName = %clKiller.name;
|
||||
//error("DamageType = " @ %damageType @ ", implement = " @ %implement @ ", implement class = " @ %implement.getClassName() @ ", is controlled = " @ %implement.getControllingClient());
|
||||
|
||||
if(%damageType == $DamageType::Explosion)
|
||||
{
|
||||
messageAll('msgExplosionKill', $DeathMessageExplosion[mFloor(getRandom() * $DeathMessageExplosionCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if(%damageType == $DamageType::Suicide) //player presses ctrl-k
|
||||
{
|
||||
messageAll('msgSuicide', $DeathMessageSuicide[mFloor(getRandom() * $DeathMessageSuicideCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if(%damageType == $DamageType::VehicleSpawn)
|
||||
{
|
||||
messageAll('msgVehicleSpawnKill', $DeathMessageVehPad[mFloor(getRandom() * $DeathMessageVehPadCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if(%damageType == $DamageType::ForceFieldPowerup)
|
||||
{
|
||||
messageAll('msgVehicleSpawnKill', $DeathMessageFFPowerup[mFloor(getRandom() * $DeathMessageFFPowerupCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if(%damageType == $DamageType::Crash)
|
||||
{
|
||||
messageAll('msgVehicleCrash', $DeathMessageVehicleCrash[%damageType, mFloor(getRandom() * $DeathMessageVehicleCrashCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if(%damageType == $DamageType::Impact) // run down by vehicle
|
||||
{
|
||||
if( ( %controller = %implement.getControllingClient() ) > 0)
|
||||
{
|
||||
%killerGender = (%controller.sex $= "Male" ? 'him' : 'her');
|
||||
%killerPoss = (%controller.sex $= "Male" ? 'his' : 'her');
|
||||
%killerName = %controller.name;
|
||||
if(%controller.team != %clVictim.team)
|
||||
{
|
||||
messageAll('msgVehicleKill', $DeathMessageVehicle[mFloor(getRandom() * $DeathMessageVehicleCount)], %victimName, %victimGender, %victimPoss, %killerName ,%killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else
|
||||
{
|
||||
messageAll('msgTeamKill', $DeathMessageTeamKill[%damageType, mFloor(getRandom() * $DeathMessageTeamKillCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
messageAll('msgVehicleKill', $DeathMessageVehicleUnmanned[mFloor(getRandom() * $DeathMessageVehicleUnmannedCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
}
|
||||
// ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// z0dd - ZOD, 5/15/02. Added Hover Vehicle so we get proper
|
||||
// death messages when killed with Wildcat chaingun
|
||||
//else if (isObject(%implement) && (%implement.getClassName() $= "Turret" || %implement.getClassName() $= "VehicleTurret" || %implement.getClassName() $= "FlyingVehicle")) //player killed by a turret
|
||||
else if (isObject(%implement) && (%implement.getClassName() $= "Turret" || %implement.getClassName() $= "VehicleTurret" || %implement.getClassName() $= "FlyingVehicle" || %implement.getClassName() $= "HoverVehicle"))
|
||||
{
|
||||
if (%implement.getControllingClient() != 0) //is turret being controlled?
|
||||
{
|
||||
%controller = %implement.getControllingClient();
|
||||
%killerGender = (%controller.sex $= "Male" ? 'him' : 'her');
|
||||
%killerPoss = (%controller.sex $= "Male" ? 'his' : 'her');
|
||||
%killerName = %controller.name;
|
||||
|
||||
if (%controller == %clVictim)
|
||||
{
|
||||
messageAll('msgTurretSelfKill', $DeathMessageTurretSelfKill[mFloor(getRandom() * $DeathMessageTurretSelfKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if (%controller.team == %clVictim.team) //controller TK'd a friendly
|
||||
{
|
||||
messageAll('msgCTurretKill', $DeathMessageCTurretTeamKill[%damageType, mFloor(getRandom() * $DeathMessageCTurretTeamKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else //controller killed an enemy
|
||||
{
|
||||
messageAll('msgCTurretKill', $DeathMessageCTurretKill[%damageType, mFloor(getRandom() * $DeathMessageCTurretKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
}
|
||||
// use the handle associated with the deployed object to verify valid owner
|
||||
else if (isObject(%implement.owner))
|
||||
{
|
||||
%owner = %implement.owner;
|
||||
//error("Owner is " @ %owner @ " Handle is " @ %implement.ownerHandle);
|
||||
//error("Turret is still owned");
|
||||
//turret is uncontrolled, but is owned - treat the same as controlled.
|
||||
%killerGender = (%owner.sex $= "Male" ? 'him' : 'her');
|
||||
%killerPoss = (%owner.sex $= "Male" ? 'his' : 'her');
|
||||
%killerName = %owner.name;
|
||||
|
||||
if (%owner.team == %clVictim.team) //player got in the way of a teammates deployed but uncontrolled turret.
|
||||
{
|
||||
messageAll('msgCTurretKill', $DeathMessageCTurretAccdtlKill[%damageType,mFloor(getRandom() * $DeathMessageCTurretAccdtlKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else //deployed, uncontrolled turret killed an enemy
|
||||
{
|
||||
messageAll('msgCTurretKill', $DeathMessageCTurretKill[%damageType,mFloor(getRandom() * $DeathMessageCTurretKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
}
|
||||
else //turret is not a placed (owned) turret (or owner is no longer on it's team), and is not being controlled
|
||||
{
|
||||
if(%implement.team == %clVictim.team) // was it a teamkill?
|
||||
{
|
||||
messageAll('msgTurretKill', $DeathMessageCTurretAccdtlKill[%damageType,mFloor(getRandom() * $DeathMessageCTurretAccdtlKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else // it was not a teamkill
|
||||
{
|
||||
messageAll('msgTurretKill', $DeathMessageTurretKill[%damageType,mFloor(getRandom() * $DeathMessageTurretKillCount)],%victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// END TURRET MESSAGES
|
||||
else if((%clKiller == %clVictim) || (%damageType == $DamageType::Ground)) //player killed himself or fell to death
|
||||
{
|
||||
messageAll('msgSelfKill', $DeathMessageSelfKill[%damageType,mFloor(getRandom() * $DeathMessageSelfKillCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if (%damageType == $DamageType::OutOfBounds) //killer died due to Out-of-Bounds damage
|
||||
{
|
||||
messageAll('msgOOBKill', $DeathMessageOOB[mFloor(getRandom() * $DeathMessageOOBCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if (%damageType == $DamageType::NexusCamping) //Victim died from camping near the nexus...
|
||||
{
|
||||
messageAll('msgCampKill', $DeathMessageCamping[mFloor(getRandom() * $DeathMessageCampingCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if(%clKiller.team == %clVictim.team) //was a TK
|
||||
{
|
||||
messageAll('msgTeamKill', $DeathMessageTeamKill[%damageType, mFloor(getRandom() * $DeathMessageTeamKillCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if (%damageType == $DamageType::Lava) //player died by falling in lava
|
||||
{
|
||||
messageAll('msgLavaKill', $DeathMessageLava[mFloor(getRandom() * $DeathMessageLavaCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if ( %damageType == $DamageType::Lightning ) // player was struck by lightning
|
||||
{
|
||||
messageAll('msgLightningKill', $DeathMessageLightning[mFloor(getRandom() * $DeathMessageLightningCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if ( %damageType == $DamageType::Mine && !isObject(%clKiller) )
|
||||
{
|
||||
messageAll('MsgRogueMineKill', $DeathMessageRogueMine[%damageType, mFloor(getRandom() * $DeathMessageRogueMineCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else //was a legitimate enemy kill
|
||||
{
|
||||
if((%damageType == $DamageType::Mine || %damageType == $DamageType::Disc) && %clVictim.mineDisc)
|
||||
{
|
||||
// mine disc just occurred
|
||||
messageAll('MsgMineDiscKill', $DeathMessageMineDisc[mFloor(getRandom() * $DeathMessageMineDiscCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
else if(%damageType == 6 && (%clVictim.headShot))
|
||||
{
|
||||
// laser headshot just occurred
|
||||
messageAll('MsgHeadshotKill', $DeathMessageHeadshot[%damageType, mFloor(getRandom() * $DeathMessageHeadshotCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
// ----------------------------------------------------
|
||||
// z0dd - ZOD, 8/25/02. Rear Lance hits
|
||||
else if (%damageType == 10 && (%clVictim.rearshot))
|
||||
{
|
||||
// shocklance rearshot just occurred
|
||||
messageAll('MsgRearshotKill', $DeathMessageRearshot[%damageType, mFloor(getRandom() * $DeathMessageRearshotCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
// ----------------------------------------------------
|
||||
else
|
||||
{
|
||||
messageAll('MsgLegitKill', $DeathMessage[%damageType, mFloor(getRandom() * $DeathMessageCount)], %victimName, %victimGender, %victimPoss, %killerName, %killerGender, %killerPoss, %damageType, $DamageTypeText[%damageType]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
if (!isActivePackage(StatsMineDisc))
|
||||
activatePackage(StatsMineDisc);
|
||||
|
|
@ -574,6 +574,20 @@ function DefaultGame::startMatch(%game)
|
|||
|
||||
function DefaultGame::gameOver( %game )
|
||||
{
|
||||
listPlayers(); // MP: 6/17/2011 - Prints score, team, status
|
||||
|
||||
// Eolk - Prevent those annoying last-minute map changes that totally throw things off
|
||||
if(%game.scheduleVote !$= "")
|
||||
{
|
||||
messageAll('closeVoteHud', "");
|
||||
cancel(Game.scheduleVote);
|
||||
Game.scheduleVote = "";
|
||||
Game.kickClient = "";
|
||||
clearVotes();
|
||||
|
||||
messageAll('MsgVoteFailed', "");
|
||||
}
|
||||
|
||||
//set the bool
|
||||
$missionRunning = false;
|
||||
|
||||
|
|
@ -617,6 +631,14 @@ function DefaultGame::gameOver( %game )
|
|||
// Default game does nothing... except lets the AI know the mission is over
|
||||
AIMissionEnd();
|
||||
|
||||
// Eolk - reset vehicle maxes after each round.
|
||||
$VehicleRespawnTime = 15000;
|
||||
$Vehiclemax[ScoutVehicle] = 4;
|
||||
$VehicleMax[AssaultVehicle] = 3;
|
||||
$VehicleMax[MobileBaseVehicle] = 1;
|
||||
$VehicleMax[ScoutFlyer] = 4;
|
||||
$VehicleMax[BomberFlyer] = 2;
|
||||
$VehicleMax[HAPCFlyer] = 2;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
@ -710,7 +732,6 @@ function DefaultGame::sendDebriefing( %game, %client )
|
|||
%score = %cl.score $= "" ? 0 : %cl.score;
|
||||
%kills = %cl.kills $= "" ? 0 : %cl.kills;
|
||||
messageClient( %client, 'MsgDebriefAddLine', "", '<lmargin:0><clip%%:40> %1</clip><lmargin%%:40><clip%%:30> %2</clip><lmargin%%:70><clip%%:17> %3</clip><lmargin%%:87><clip%%:13> %4</clip>', %cl.name, %game.getTeamName(%cl.team), %score, %kills );
|
||||
|
||||
%count[%highTeam]++;
|
||||
%notDone = false;
|
||||
for ( %team = 1; %team - 1 < %game.numTeams; %team++ )
|
||||
|
|
@ -744,8 +765,13 @@ function DefaultGame::sendDebriefing( %game, %client )
|
|||
messageClient( %client, 'MsgDebriefAddLine', "", '<lmargin:0><clip%%:60> %1</clip><lmargin%%:60><clip%%:40> %2</clip>', %cl.name, %score);
|
||||
}
|
||||
}
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
sendEvoDebriefing(%client);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
function DefaultGame::clearDeployableMaxes(%game)
|
||||
{
|
||||
|
|
@ -1093,6 +1119,7 @@ function DefaultGame::forceObserver( %game, %client, %reason )
|
|||
messageClient(%client, 'MsgClientJoinTeam', '\c2You have become an observer.', %client.name, %game.getTeamName(0), %client, 0 );
|
||||
logEcho(%client.nameBase@" (cl "@%client@") entered observer mode");
|
||||
%client.lastTeam = %client.team;
|
||||
%scheduleAutoKick = true;
|
||||
|
||||
case "AdminForce":
|
||||
%client.camera.getDataBlock().setMode( %client.camera, "observerFly" );
|
||||
|
|
@ -1124,6 +1151,18 @@ function DefaultGame::forceObserver( %game, %client, %reason )
|
|||
logEcho(%client.nameBase@" (cl "@%client@") was placed in observer mode due to spawn delay");
|
||||
// save the team the player was on - only if this was a delay in respawning
|
||||
%client.lastTeam = %client.team;
|
||||
%scheduleAutoKick = true;
|
||||
}
|
||||
|
||||
if (%scheduleAutoKick && !%client.isAdmin && !$Host::TournamentMode && $Host::KickObserverTimeout )
|
||||
{
|
||||
%minutes = $Host::KickObserverTimeout / 60;
|
||||
messageClient(%client, 'MsgNoObservers', '\c2You have %1 minutes to join the game or you will be kicked.', %minutes);
|
||||
|
||||
%key = mFloor(getRandom() * 1000);
|
||||
%client.okkey = %key;
|
||||
|
||||
schedule(($Host::KickObserverTimeout * 1000), 0, "cmdAutoKickObserver", %client, %key);
|
||||
}
|
||||
|
||||
// switch client to team 0 (observer)
|
||||
|
|
@ -1154,6 +1193,26 @@ function DefaultGame::forceObserver( %game, %client, %reason )
|
|||
|
||||
}
|
||||
|
||||
// cmdAutoKickObserver(%client)
|
||||
// Info: Will kick the player if he/she is still in observer.
|
||||
function cmdAutoKickObserver(%client, %key) // Edit GG
|
||||
{
|
||||
if (($Host::TournamentMode) || (!$MissionRunning) || (%client.isAdmin) || (%client.team != 0) || (!%client.okkey) || (%client.okkey != %key))
|
||||
return;
|
||||
|
||||
%client.okkey = "";
|
||||
if( isObject( %client.player ) )
|
||||
%client.player.scriptKill(0);
|
||||
|
||||
if ( isObject( %client ) )
|
||||
{
|
||||
messageAll('MsgAdminForce', '\c2%1 has left the game. (Observer Timeout)', %client.nameBase);
|
||||
|
||||
%client.setDisconnectReason( "Observer Timeout" );
|
||||
%client.schedule(700, "delete");
|
||||
}
|
||||
}
|
||||
|
||||
function DefaultGame::displayDeathMessages(%game, %clVictim, %clKiller, %damageType, %implement)
|
||||
{
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
|
@ -1663,7 +1722,10 @@ function DefaultGame::clientMissionDropReady(%game, %client)
|
|||
commandToClient(%client, 'setHudMode', 'Observer');
|
||||
%client.setControlObject( %client.camera );
|
||||
//displayObserverHud( %client, 0 );
|
||||
updateObserverFlyHud(%client);
|
||||
// Eolk - flag stats stuff
|
||||
//updateObserverFlyHud(%client);
|
||||
if($Host::ClassicEvoStats && $CurrentMissionType $= "CTF")
|
||||
schedule(10000, %client, updateObserverFlyHud, %client);
|
||||
}
|
||||
|
||||
if( !%observer )
|
||||
|
|
@ -1683,7 +1745,18 @@ function DefaultGame::clientMissionDropReady(%game, %client)
|
|||
commandToClient(%client, 'setHudMode', 'Standard'); // the game has already started
|
||||
%client.setControlObject( %client.player );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( $Host::ClassicEvoStats && ($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF") )
|
||||
{
|
||||
%nickTeam1 = ($flagstats::heldTeam1 ? $flagstats::nickTeam1 : "N/A");
|
||||
%realTeam1 = ($flagstats::heldTeam1 ? $flagstats::realTeam1 : "N/A");
|
||||
|
||||
%nickTeam2 = ($flagstats::heldTeam2 ? $flagstats::nickTeam2 : "N/A");
|
||||
%realTeam2 = ($flagstats::heldTeam2 ? $flagstats::realTeam2 : "N/A");
|
||||
|
||||
BottomPrint(%client, "Best caps on " @ $CurrentMission @ ":\n" @ getTaggedString(%game.getTeamName(1)) @ ":" SPC %nickTeam1 @ " in " @ %realTeam1 @ " seconds\n" @ getTaggedString(%game.getTeamName(2)) @ ":" SPC %nickTeam2 @ " in " @ %realTeam2 @ " seconds", 10, 3);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1719,6 +1792,12 @@ function DefaultGame::clientMissionDropReady(%game, %client)
|
|||
echo("Client" SPC %client SPC "is ready.");
|
||||
|
||||
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
||||
$stats::tk[%client] = "";
|
||||
%client.midairs = 0;
|
||||
%client.PlaMA = 0;
|
||||
%client.hs = "";
|
||||
for(%i = 1; %i <= 13; %i++)
|
||||
$stats::weapon_damage[%client, %i] = "";
|
||||
}
|
||||
|
||||
function DefaultGame::sendClientTeamList(%game, %client)
|
||||
|
|
@ -2759,40 +2838,41 @@ function DefaultGame::sendGameVoteMenu( %game, %client, %key )
|
|||
{
|
||||
// Actual vote options:
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission' );
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit');
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' );
|
||||
|
||||
if( $Host::TournamentMode )
|
||||
{
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode' );
|
||||
|
||||
if(!$MatchStarted && !$CountdownStarted)
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match' );
|
||||
}
|
||||
else
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Vote Tournament Mode' );
|
||||
//if( $Host::TournamentMode )
|
||||
//{
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFFAMode', 'Change server to Free For All.', 'Vote Free For All Mode' );
|
||||
//
|
||||
// if(!$MatchStarted && !$CountdownStarted)
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match' );
|
||||
//}
|
||||
//else
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'Change server to Tournament.', 'Vote Tournament Mode' );
|
||||
|
||||
if ( %multipleTeams )
|
||||
{
|
||||
if(!$MatchStarted && !$Host::TournamentMode)
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Change your Team' );
|
||||
|
||||
if ( $teamDamage )
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage' );
|
||||
else
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage' );
|
||||
//if ( $teamDamage )
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Vote to Disable Team Damage' );
|
||||
//else
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Vote to Enable Team Damage' );
|
||||
|
||||
if($CurrentMissionType !$= TR2) // z0dd - ZOD, 5/23/03. Added vote for Random and Fair teams
|
||||
{
|
||||
if ( $RandomTeams )
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteRandomTeams', 'disable random teams', 'Vote to Disable Random Teams' );
|
||||
else
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteRandomTeams', 'enable random teams', 'Vote to Enable Random Teams' );
|
||||
//if($CurrentMissionType !$= TR2) // z0dd - ZOD, 5/23/03. Added vote for Random and Fair teams
|
||||
//{
|
||||
//if ( $RandomTeams )
|
||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteRandomTeams', 'disable random teams', 'Vote to Disable Random Teams' );
|
||||
//else
|
||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteRandomTeams', 'enable random teams', 'Vote to Enable Random Teams' );
|
||||
|
||||
if ( $FairTeams )
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFairTeams', 'disable fair teams', 'Vote to Disable Fair Teams' );
|
||||
else
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFairTeams', 'enable fair teams', 'Vote to Enable Fair Teams' );
|
||||
}
|
||||
//if ( $FairTeams )
|
||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFairTeams', 'disable fair teams', 'Vote to Disable Fair Teams' );
|
||||
//else
|
||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFairTeams', 'enable fair teams', 'Vote to Enable Fair Teams' );
|
||||
//}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -2816,23 +2896,23 @@ function DefaultGame::sendGameVoteMenu( %game, %client, %key )
|
|||
if(!$MatchStarted)
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'ChooseTeam', "", 'Choose Team' );
|
||||
|
||||
if ( $teamDamage )
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage' );
|
||||
else
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage' );
|
||||
//if ( $teamDamage )
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'disable team damage', 'Disable Team Damage' );
|
||||
//else
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteTeamDamage', 'enable team damage', 'Enable Team Damage' );
|
||||
|
||||
if($CurrentMissionType !$= TR2) // z0dd - ZOD, 5/23/03. Added vote for Random and Fair teams
|
||||
{
|
||||
if ( $RandomTeams )
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteRandomTeams', 'disable random teams', 'Disable Random Teams' );
|
||||
else
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteRandomTeams', 'enable random teams', 'Enable Random Teams' );
|
||||
//if($CurrentMissionType !$= TR2) // z0dd - ZOD, 5/23/03. Added vote for Random and Fair teams
|
||||
//{
|
||||
// if ( $RandomTeams )
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteRandomTeams', 'disable random teams', 'Disable Random Teams' );
|
||||
// else
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteRandomTeams', 'enable random teams', 'Enable Random Teams' );
|
||||
|
||||
if ( $FairTeams )
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFairTeams', 'disable fair teams', 'Disable Fair Teams' );
|
||||
else
|
||||
messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFairTeams', 'enable fair teams', 'Enable Fair Teams' );
|
||||
}
|
||||
// if ( $FairTeams )
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFairTeams', 'disable fair teams', 'Disable Fair Teams' );
|
||||
// else
|
||||
// messageClient( %client, 'MsgVoteItem', "", %key, 'VoteFairTeams', 'enable fair teams', 'Enable Fair Teams' );
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2969,7 +3049,7 @@ function DefaultGame::voteChangeMission(%game, %admin, %missionDisplayName, %typ
|
|||
else
|
||||
{
|
||||
%totalVotes = %game.totalVotesFor + %game.totalVotesAgainst;
|
||||
if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100))
|
||||
if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone)) > ($Host::VotePasspercent / 100))
|
||||
{
|
||||
messageAll('MsgVotePassed', '\c2The mission was changed to %1 (%2) by vote.', %missionDisplayName, %typeDisplayName );
|
||||
logEcho("mission changed to "@%missionDisplayName@"/"@%typeDisplayName@" (vote)");
|
||||
|
|
@ -3062,7 +3142,7 @@ 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));
|
||||
setModeTournament( %mission, %missionType );
|
||||
|
|
@ -3106,8 +3186,8 @@ function DefaultGame::voteMatchStart( %game, %admin)
|
|||
{
|
||||
%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', '\c2The match has been started by vote: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone) * 100));
|
||||
startTourneyCountdown();
|
||||
}
|
||||
|
|
@ -3136,7 +3216,7 @@ function DefaultGame::voteFFAMode( %game, %admin, %client )
|
|||
{
|
||||
%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 Free For All mode by vote.', %client);
|
||||
setModeFFA($CurrentMission, $CurrentMissionType);
|
||||
|
|
@ -3168,7 +3248,7 @@ function DefaultGame::voteChangeTimeLimit( %game, %admin, %newLimit )
|
|||
{
|
||||
%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', '\c2The mission time limit was set to %1 minutes by vote.', %display);
|
||||
$Host::TimeLimit = %newLimit;
|
||||
|
|
@ -3212,7 +3292,7 @@ function DefaultGame::voteResetServer( %game, %admin, %client )
|
|||
{
|
||||
%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', '\c2The Server has been reset by vote.' );
|
||||
resetServerDefaults();
|
||||
|
|
@ -3295,7 +3375,7 @@ function DefaultGame::voteAdminPlayer(%game, %admin, %client)
|
|||
{
|
||||
%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('MsgAdminPlayer', '\c2%2 was made an admin by vote.', %client, %client.name);
|
||||
%client.isAdmin = 1;
|
||||
|
|
@ -3751,9 +3831,6 @@ function notifyMatchEnd(%time)
|
|||
|
||||
if (%seconds > 1) {
|
||||
MessageAll('MsgMissionEnd', '\c2Match ends in %1 seconds.~wfx/misc/hunters_%1.wav', %seconds);
|
||||
if (%seconds == 60) {
|
||||
MessageAll('MsgNotifyEvoNextMission', '\c2Next Mission: \c1%1', $EvoCachedNextMission);
|
||||
}
|
||||
}
|
||||
else if (%seconds == 1)
|
||||
MessageAll('MsgMissionEnd', '\c2Match ends in 1 second.~wfx/misc/hunters_1.wav');
|
||||
|
|
|
|||
|
|
@ -2831,7 +2831,7 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
|||
|
||||
%targetClient.lastDamagedBy = %damagingClient;
|
||||
%targetClient.lastDamaged = getSimTime();
|
||||
|
||||
|
||||
//now call the "onKilled" function if the client was... you know...
|
||||
if(%targetObject.getState() $= "Dead")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ function getValidMap(%misType)
|
|||
|
||||
function findNextCycleMission(%type)
|
||||
{
|
||||
%numPlayers = ClientGroup.getCount();
|
||||
%numPlayers = 1;
|
||||
if($Host::ClassicCycleMisTypes || $Host::ClassicRandomMisTypes)
|
||||
{
|
||||
%tempMission = getValidMap(%type);
|
||||
|
|
@ -323,6 +323,11 @@ function findNextCycleMission(%type)
|
|||
{
|
||||
%nextMissionIndex = getNextMission(%tempMission, %type);
|
||||
%nextPotentialMission = $HostMissionFile[%nextMissionIndex];
|
||||
// Eolk
|
||||
$MapPlayed[%nextPotentialMission] = 1;
|
||||
$MapPlayedCount++;
|
||||
// error("SH: "@%type@", "@%nextPotentialMission);
|
||||
// error("POT MAP: "@%nextPotentialMission);
|
||||
|
||||
//just cycle to the next if we've gone all the way around...
|
||||
if (%nextPotentialMission $= $CurrentMission || %failsafe >= 1000)
|
||||
|
|
@ -332,20 +337,18 @@ function findNextCycleMission(%type)
|
|||
return $HostMissionFile[%nextMissionIndex];
|
||||
}
|
||||
|
||||
//get the player count limits for this mission
|
||||
%limits = $Host::MapPlayerLimits[%nextPotentialMission, %type];
|
||||
if (%limits $= "")
|
||||
return %nextPotentialMission;
|
||||
else
|
||||
{
|
||||
%minPlayers = getWord(%limits, 0);
|
||||
%maxPlayers = getWord(%limits, 1);
|
||||
%numPlayers = ClientGroup.getCount();
|
||||
%minPlayers = $MapCycleMinPlayers[%type, %nextPotentialMission];
|
||||
%maxPlayers = $MapCycleMaxPlayers[%type, %nextPotentialMission];
|
||||
// error("MINPLAYERS: "@%minPlayers@", MAXPLAYERS: "@%maxPlayers);
|
||||
if(%minPlayers $= "" || %maxPlayers $= "")
|
||||
return;
|
||||
|
||||
if ((%minPlayers < 0 || %minPlayers == -1 || %numPlayers >= %minPlayers) && (%maxPlayers < 0 || %maxPlayers == -1 || %numPlayers <= %maxPlayers))
|
||||
if ((%minPlayers < 0 || %minPlayers == -1 || %numPlayers >= %minPlayers) && (%maxPlayers < 0 || %maxPlayers == -1 || %numPlayers <= %maxPlayers))
|
||||
return %nextPotentialMission;
|
||||
}
|
||||
|
||||
//since we didn't return the mission, we must not have an acceptable number of players - check the next
|
||||
error("SKIPPING MAP, player count unacceptable");
|
||||
%tempMission = %nextPotentialMission;
|
||||
%failsafe++;
|
||||
}
|
||||
|
|
@ -353,6 +356,9 @@ function findNextCycleMission(%type)
|
|||
|
||||
function CycleMissions()
|
||||
{
|
||||
if(Game.scheduleVote !$= "") // a vote is still running, stop it
|
||||
stopCurrentVote();
|
||||
|
||||
echo( "cycling mission. " @ ClientGroup.getCount() @ " clients in game." );
|
||||
if($Host::ClassicCycleMisTypes && !$Host::ClassicRandomMisTypes)
|
||||
{
|
||||
|
|
@ -899,22 +905,9 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
|||
$HostGamePlayerCount++;
|
||||
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
||||
|
||||
// Eolk - Fix logging.
|
||||
if( $Host::ClassicConnectLog )
|
||||
{
|
||||
// z0dd - ZOD, 5/07/04. New logging method based on AurLogging by Aureole
|
||||
%file = $Host::ClassicConnLogPath @"/"@ formatTimeString("mm.dd.yy") @ "Connect.csv";
|
||||
%conn = new FileObject();
|
||||
%conn.openForAppend(%file);
|
||||
%conn.writeLine("\"" @ formatTimeString("mm.dd.yy - h:nn:ss A") @ "\"," @ %client.nameBase @ "\"," @ %client.guid @ "," @ getSubStr(%client.getAddress(), 3, strlen(%client.getAddress())));
|
||||
%conn.close();
|
||||
%conn.delete();
|
||||
echo( "exporting client info to connect.csv..." );
|
||||
|
||||
// z0dd - ZOD - Founder, 5/25/03. Connect log
|
||||
//$conn::new[$ConnectCount++] = "Player: " @ %client.nameBase @ " Real Name: " @ %realName @ " Guid: " @ %client.guid @ " Connected from: " @ %client.getAddress();
|
||||
//%file = formatTimeString("mm.dd.yy") @ "Connect.log";
|
||||
//export("$conn::*", $Host::ClassicConnLogPath @"/"@ %file, true);
|
||||
}
|
||||
connectLog(%client, 0);
|
||||
|
||||
// z0dd - ZOD 4/29/02. Activate the clients Classic Huds
|
||||
// and start off with 0 SAD access attempts.
|
||||
|
|
@ -953,6 +946,84 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
|||
}
|
||||
}
|
||||
}
|
||||
if($Host::EmptyServerReset && isEventPending($EmptyServerResetSchedule))
|
||||
{
|
||||
error(formatTimeString("HH:nn:ss") SPC "Previous Timed Server Reset schedule cancelled..." );
|
||||
cancel($EmptyServerResetSchedule);
|
||||
}
|
||||
|
||||
if($Host::GuidCheck)
|
||||
{
|
||||
// If we don't have a GUID try to find one somewhere.
|
||||
if(! %client.guid || %client.guid $= "")
|
||||
{
|
||||
%client.guid = getField(%client.getAuthInfo(),3);
|
||||
}
|
||||
// If we don't have a name, try to get one.
|
||||
if(!%name || %name $= "")
|
||||
{
|
||||
%name = getField(%client.getAuthInfo(),0);
|
||||
%client.nameBase = %name;
|
||||
}
|
||||
// If we still don't have a GUID or name, time to boot the player (unless a local game).
|
||||
if(getIPAddress(%client) !$= "Local" && (!%client.guid $= "" || %name $= ""))
|
||||
{
|
||||
//statEchoInfo("No name/GUID kick for CID (" @ %client @ ") with IP (" @ getIPAddress(%client) @ ")");
|
||||
KickByCID(%client, "You joined the server with a blank name and/or GUID. Try rejoining.",2);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// From Eolks
|
||||
// Minor improvement by Teratos
|
||||
function getIPAddress(%client)
|
||||
{
|
||||
%port = nextToken(nextToken(%client.getAddress(), "ip", ":"), "addr", ":");
|
||||
if(%client.isAIControlled()) {
|
||||
%addr = "bot";
|
||||
}
|
||||
return (%addr $= "" ? "Local" : %addr);
|
||||
}
|
||||
|
||||
// From Eolks
|
||||
// We are not an admin MOD but this comes in handy when name is missing on races.
|
||||
function KickByCID(%client, %reason, %time)
|
||||
{
|
||||
if(!isObject(%client))
|
||||
return;
|
||||
|
||||
// AI handler
|
||||
if(%client.isAIControlled())
|
||||
{
|
||||
%client.drop();
|
||||
$HostGameBotCount--;
|
||||
if($HostGameBotCount < 0)
|
||||
$HostGameBotCount = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (%reason $= "")
|
||||
%reason = "You have been kicked from the server.";
|
||||
// Perhaps we don't want time done.
|
||||
//if (%time < 0 || %time $= "")
|
||||
// %time = $Host::KickBanTime;
|
||||
|
||||
// Send proper messages
|
||||
messageClient(%client, 'onClientKicked', "");
|
||||
messageAllExcept(%client, -1, 'MsgClientDrop', "", %client.name, %client);
|
||||
|
||||
// Remove their player, if one exists
|
||||
if (isObject(%client.player))
|
||||
%client.player.scriptKill(0);
|
||||
|
||||
// Set reason, schedule removal
|
||||
%client.setDisconnectReason(%reason);
|
||||
%client.schedule(500, "delete");
|
||||
|
||||
// Keep them out
|
||||
// if(%time != 0)
|
||||
// BanList::add(%client.guid, %client.getAddress(), %time);
|
||||
}
|
||||
|
||||
function GameConnection::onDrop(%client, %reason)
|
||||
|
|
@ -960,6 +1031,10 @@ function GameConnection::onDrop(%client, %reason)
|
|||
if(isObject(Game))
|
||||
Game.onClientLeaveGame(%client);
|
||||
|
||||
// Eolk - Fix logging.
|
||||
if( $Host::ClassicConnectLog )
|
||||
connectLog(%client, 1);
|
||||
|
||||
// make sure that tagged string of player name is not used
|
||||
if ( $CurrentMissionType $= "SinglePlayer" )
|
||||
messageAllExcept(%client, -1, 'MsgClientDrop', "", getTaggedString(%client.name), %client);
|
||||
|
|
@ -981,6 +1056,8 @@ function GameConnection::onDrop(%client, %reason)
|
|||
echo("CDROP: " @ %client @ " " @ %client.getAddress());
|
||||
$HostGamePlayerCount--;
|
||||
|
||||
// schedule(1000, 0, "updateAdminModHud"); // Have to delay this a bit so it actually updates correctly, since the client isn't deleted in this function.
|
||||
|
||||
// z0dd - ZOD, 5/05/04. Add a bot for every client drop if balanced bots are set
|
||||
if( $Host::BotsEnabled )
|
||||
{
|
||||
|
|
@ -1006,22 +1083,90 @@ function GameConnection::onDrop(%client, %reason)
|
|||
AutoPWServer(0);
|
||||
}
|
||||
// reset the server if everyone has left the game
|
||||
//if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission )
|
||||
// schedule(0, 0, "resetServerDefaults");
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
// z0dd - ZOD, 5/12/02. Reset the server if everyone has left the game and set this mission as startup mission.
|
||||
// This helps with $Host::ClassicRandomMissions to keep the random more random.
|
||||
if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated && !$resettingServer && !$LoadingMission )
|
||||
{
|
||||
$Host::Map = $CurrentMission;
|
||||
export("$Host::*", $serverprefs, false);
|
||||
$Host::MissionType = $CurrentMissionType;
|
||||
export("$Host::*", $serverprefs, false);
|
||||
schedule(10, 0, "resetServerDefaults");
|
||||
if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::EmptyServerReset && !$resettingServer && !$LoadingMission && $CurrentMissionType !$= $Host::MissionType )
|
||||
{
|
||||
// Timed Server Reset: $Host::EmptyServerReset = 1; --- Time in Minutes $Host::EmptyServerResetTime = 120;
|
||||
if(isEventPending($EmptyServerResetSchedule))
|
||||
{
|
||||
error(formatTimeString("HH:nn:ss") SPC "Previous Timed Server Reset schedule cancelled..." );
|
||||
cancel($EmptyServerResetSchedule);
|
||||
}
|
||||
|
||||
%resettime = $Host::EmptyServerResetTime * 60000;
|
||||
if(%resettime <= 0) %resettime = 1;
|
||||
$EmptyServerResetSchedule = schedule(%resettime, 0, "ResetServerTimed");
|
||||
error(formatTimeString("HH:nn:ss") SPC "Timed Server Reset schedule started..." );
|
||||
}
|
||||
// ------------------------------------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
function ResetServerTimed()
|
||||
{
|
||||
if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::EmptyServerReset && !$resettingServer && !$LoadingMission )
|
||||
schedule(10, 0, "resetServerDefaults");
|
||||
// Instead of simply resetting the defaults, reinitialize the
|
||||
// entire server...
|
||||
// ReallyQuit();
|
||||
else
|
||||
error(formatTimeString("HH:nn:ss") SPC "Timed Server Reset schedule cancelled (Someone on server)..." );
|
||||
}
|
||||
|
||||
// resetServerDefaults()
|
||||
// Info: Re-load the current server prefs and reset some variables
|
||||
function resetServerDefaults()
|
||||
{
|
||||
$resettingServer = true;
|
||||
echo( "Resetting server defaults..." );
|
||||
|
||||
if( isObject( Game ) )
|
||||
Game.gameOver();
|
||||
|
||||
// Override server defaults with prefs:
|
||||
exec( "scripts/ServerDefaults.cs" );
|
||||
exec( $serverprefs );
|
||||
|
||||
$MaxPlayers = $Host::MaxPlayers;
|
||||
$BackupPassword = $Host::Password;
|
||||
$Host::TimeLimit = $DefaultTimeLimit;
|
||||
$NoBaseRape = 1;
|
||||
$Host::TournamentMode = 0;
|
||||
|
||||
// ---------------------------------------------------
|
||||
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
||||
//convert the team skin and name vars to tags...
|
||||
%index = 0;
|
||||
while ($Host::TeamSkin[%index] !$= "")
|
||||
{
|
||||
$TeamSkin[%index] = addTaggedString($Host::TeamSkin[%index]);
|
||||
%index++;
|
||||
}
|
||||
|
||||
%index = 0;
|
||||
while ($Host::TeamName[%index] !$= "")
|
||||
{
|
||||
$TeamName[%index] = addTaggedString($Host::TeamName[%index]);
|
||||
%index++;
|
||||
}
|
||||
|
||||
// Get the hologram names from the prefs...
|
||||
%index = 1;
|
||||
while ( $Host::holoName[%index] !$= "" )
|
||||
{
|
||||
$holoName[%index] = $Host::holoName[%index];
|
||||
%index++;
|
||||
}
|
||||
// ---------------------------------------------------
|
||||
|
||||
// kick all bots...
|
||||
removeAllBots();
|
||||
|
||||
// add bots back if they were there before..
|
||||
if( $Host::botsEnabled ) // z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
||||
initGameBots( $Host::Map, $Host::MissionType );
|
||||
|
||||
// load the missions
|
||||
loadMission( $Host::Map, $Host::MissionType );
|
||||
$resettingServer = false;
|
||||
echo( "Server reset complete." );
|
||||
}
|
||||
|
||||
function dismountPlayers()
|
||||
|
|
@ -1044,10 +1189,10 @@ function loadMission( %missionName, %missionType, %firstMission )
|
|||
if ($AutoRestart) // z0dd - ZOD, 3/26/02. Auto restart server after a specified time.
|
||||
{
|
||||
$AutoRestart = 0;
|
||||
messageAll( 'MsgServerRestart', '\c2SERVER IS AUTO REBOOTING! COME BACK IN 5 MINUTES.~wfx/misc/red_alert.wav');
|
||||
messageAll( 'MsgServerRestart', '\c2SERVER IS NOW AUTO RESTARTING!.~wfx/misc/red_alert.wav');
|
||||
logEcho("Auto server restart commencing.");
|
||||
//schedule(10000, 0, "CreateServer", %missionName, %missionType); // this wasn't working as a cure for servers with NULLs
|
||||
schedule(10000, 0, quit );
|
||||
schedule(5000, 0, quit );
|
||||
}
|
||||
|
||||
// z0dd - ZOD, 9/29/02. Removed T2 demo code from here
|
||||
|
|
@ -1088,6 +1233,47 @@ function loadMission( %missionName, %missionType, %firstMission )
|
|||
sendLoadInfoToClient( %client );
|
||||
}
|
||||
|
||||
if($Host::ClassicEvoStats)
|
||||
{
|
||||
deleteVariables("$*stats::*");
|
||||
if(%missionType $= "CTF" || %missionType $= "SCtF")
|
||||
{
|
||||
%fileIn = "stats/maps/classic/" @ %missionType @ "/" @ %missionName @ ".txt";
|
||||
|
||||
// Initialize the file if not exist
|
||||
if(!isFile(%fileIn))
|
||||
{
|
||||
$flagstats::heldTeam1 = 0;
|
||||
$flagstats::realTeam1 = 0;
|
||||
$flagstats::nickTeam1 = 0;
|
||||
$flagstats::heldTeam2 = 0;
|
||||
$flagstats::realTeam2 = 0;
|
||||
$flagstats::nickTeam2 = 0;
|
||||
|
||||
export("$flagstats::*", %fileIn, false);
|
||||
}
|
||||
|
||||
exec(%fileIn);
|
||||
}
|
||||
}
|
||||
|
||||
// Eolk - Testing new stuff to make map rotation less stale.
|
||||
if($CurrentMissionType !$= %missionType && !%firstMission)
|
||||
deleteVariables("$MapPlayed*");
|
||||
|
||||
// reset the default time limit if changed
|
||||
if($TimeLimitChanged)
|
||||
{
|
||||
$Host::TimeLimit = $DefaultTimeLimit;
|
||||
$TimeLimitChanged = 0;
|
||||
}
|
||||
|
||||
if(!$MapPlayed[%missionName] && $ReverseMapCycle[%missionName])
|
||||
{
|
||||
$MapPlayed[%missionName] = 1;
|
||||
$MapPlayedCount++;
|
||||
}
|
||||
|
||||
// allow load condition to exit out
|
||||
schedule(0,ServerGroup,loadMissionStage1,%missionName,%missionType,%firstMission);
|
||||
}
|
||||
|
|
@ -1379,6 +1565,12 @@ function serverCmdMissionStartPhase3Done(%client, %seq)
|
|||
|
||||
%client.isReady = true;
|
||||
Game.clientMissionDropReady(%client);
|
||||
|
||||
if(!%client.seenMOTD && $Host::ClassicMOTD !$= "")
|
||||
{
|
||||
centerPrint(%client, $Host::ClassicMOTD, $Host::ClassicMOTDTime, $Host::ClassicMOTDLines);
|
||||
%client.seenMOTD = true;
|
||||
}
|
||||
}
|
||||
|
||||
function serverSetClientTeamState( %client )
|
||||
|
|
@ -1556,7 +1748,7 @@ function serverCmdSAD(%client, %password)
|
|||
%client.isAdmin = true;
|
||||
%client.isSuperAdmin = true;
|
||||
MessageAll( 'MsgSuperAdminPlayer', '\c2%2 has become a Super Admin by force.', %client, %name);
|
||||
logEcho(%client.nameBase @ " has become a Super Admin by force.");
|
||||
ClassicAdminLog("SAD", %client.nameBase @ " has become a Super Admin by force.");
|
||||
}
|
||||
|
||||
case $Host::AdminPassword:
|
||||
|
|
@ -1570,7 +1762,7 @@ function serverCmdSAD(%client, %password)
|
|||
%client.isAdmin = true;
|
||||
%client.isSuperAdmin = false;
|
||||
MessageAll( 'MsgAdminForce', '\c2%2 has become a Admin by force.', %client, %name);
|
||||
logEcho(%client.nameBase @ " has become an Admin by force.");
|
||||
ClassicAdminLog("AD", %client.nameBase @ " has become an Admin by force.");
|
||||
}
|
||||
default:
|
||||
messageClient(%client, 'MsgPasswordFailed', '\c2Illegal SAD PW.');
|
||||
|
|
@ -1589,7 +1781,7 @@ function serverCmdSAD(%client, %password)
|
|||
%client.setDisconnectReason( 'For attempting to exploit SAD to gain unauthorized Admin by entering\ntoo many passwords, you are being Banned.' );
|
||||
%client.schedule(700, "delete");
|
||||
BanList::add(%client.guid, %client.getAddress(), $Host::BanTime);
|
||||
logEcho(%client.nameBase @ " " @ %client.guid @ " has been banned for excessive use of SAD");
|
||||
ClassicAdminLog("BAN", %client.nameBase@" has been banned for attempting to exploit the SAD password.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3185,4 +3377,4 @@ function serverCmdcanUpdateClanTag(%client, %tag)
|
|||
function GameConnection::ResetTagSwitchWait(%this)
|
||||
{
|
||||
%this.isTagWaiting = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
$Host::useCustomSkins = 0;
|
||||
$Host::useCustomSkins = 1;
|
||||
|
||||
$Host::teamSkin[0] = "blank";
|
||||
$Host::teamSkin[1] = "base";
|
||||
|
|
@ -26,10 +26,11 @@ $Host::holoName[6] = "Harbinger";
|
|||
|
||||
// -----------------------------------------
|
||||
// z0dd - ZOD, 9/29/02. Removed T2 demo code
|
||||
$Host::GameName = "Tribes 2 Classic Server";
|
||||
$Host::Info = "This is a Tribes 2 Classic Server.";
|
||||
$Host::Map = "Katabatic";
|
||||
$Host::MaxPlayers = 64;
|
||||
$Host::GameName = "Tribes 2 Test";
|
||||
$Host::Info = " ";
|
||||
$Host::Map = "VaubanLak";
|
||||
$Host::MaxPlayers = 30;
|
||||
$Host::MissionType = "LakRabbit";
|
||||
// -----------------------------------------
|
||||
|
||||
// ------------------------------------------------
|
||||
|
|
@ -77,6 +78,7 @@ $Host::ClassicLoadBlasterChanges = 0; // Blaster shoots 6 projec
|
|||
$Host::ClassicLoadPlayerChanges = 0; // Load up new gameplay changes allowing players to be shot while in vehicles.
|
||||
$Host::ClassicLoadMineChanges = 0; // Enable/Disable mine disc.
|
||||
$Host::ClassicLoadVRamChanges = 0; // Vehicles take damage when ramming players.
|
||||
|
||||
// ------------------------------------------------
|
||||
|
||||
$Host::AdminList = ""; // all players that will be automatically an admin upon joining server
|
||||
|
|
@ -84,15 +86,14 @@ $Host::SuperAdminList = ""; // all players that will be automatically a super a
|
|||
$Host::BindAddress = ""; // set to an ip address if the server wants to specify which NIC/IP to use
|
||||
$Host::Port = 28000;
|
||||
$Host::Password = "";
|
||||
$Host::PureServer = 1;
|
||||
$Host::PureServer = 0;
|
||||
$Host::Dedicated = 0;
|
||||
$Host::MissionType = "CTF";
|
||||
$Host::TimeLimit = 30;
|
||||
$Host::BotCount = 2;
|
||||
$Host::TimeLimit = 45;
|
||||
$Host::BotCount = 0;
|
||||
$Host::BotsEnabled = 0;
|
||||
$Host::MinBotDifficulty = 0.5;
|
||||
$Host::MaxBotDifficulty = 0.75;
|
||||
$Host::NoSmurfs = 0;
|
||||
$Host::NoSmurfs = 1;
|
||||
$Host::VoteTime = 30; // amount of time before votes are calculated
|
||||
$Host::VotePassPercent = 60; // percent needed to pass a vote
|
||||
$Host::KickBanTime = 300; // specified in seconds
|
||||
|
|
@ -100,11 +101,11 @@ $Host::BanTime = 1800; // specified in seconds
|
|||
$Host::PlayerRespawnTimeout = 60; // time before a dead player is forced into observer mode
|
||||
$Host::warmupTime = 20;
|
||||
$Host::TournamentMode = 0;
|
||||
$Host::allowAdminPlayerVotes = 1;
|
||||
$Host::allowAdminPlayerVotes = 0;
|
||||
$Host::FloodProtectionEnabled = 1;
|
||||
$Host::MaxMessageLen = 120;
|
||||
$Host::VoteSpread = 20;
|
||||
$Host::TeamDamageOn = 0;
|
||||
$Host::TeamDamageOn = 1;
|
||||
$Host::Siege::Halftime = 20000;
|
||||
$Host::CRCTextures = 0;
|
||||
|
||||
|
|
@ -119,11 +120,9 @@ $Audio::maxVoiceChannels = 2;
|
|||
$Host::EmptyServerReset = 1; //To control whether the server auto resets when empty
|
||||
$Host::EmptyServerResetTime = 120; //Time in Minutes to reset an empty server
|
||||
$Host::EnableAutobalance = 1; //Will autobalance when teams are uneven.
|
||||
$Host::EnableMapRepetitionChecker = 1; //Enable or Disable the Map Repetition Checker
|
||||
$Host::EnableMortarTurret = 0; //Enable or Disable Mortar Turret
|
||||
$Host::EnableNetTourneyClient = 1; //Enable or Disable Tourney Net Client checking
|
||||
$Host::EnableNetTourneyClient = 0; //Enable or Disable Tourney Net Client checking
|
||||
$Host::EnableNoBaseRapeNotify = 1; //Get a base rape notification
|
||||
$Host::EnableSetNextMission = 1; //Let admins set the next mission thru the vote menu
|
||||
$Host::EnableTeamBalanceNotify = 1; //Get a teambalance notification
|
||||
$Host::EnableTurretPlayerCount = 10; //How many to enable turrets
|
||||
$Host::EnableVoteSound = 1; //If you want a sound chime during voting
|
||||
|
|
@ -132,10 +131,9 @@ $Host::AntiCloakPlayerCount = 6; //How many to enable Cloak
|
|||
$Host::PUGautoPassword = 0; //Auto enable a password in tournament mode
|
||||
$Host::PUGPassword = "pickup"; //PUG password, Auto or enable/disable thru admin menu
|
||||
$Host::PUGpasswordAlwaysOn = 0; //If you want the pug password Always on
|
||||
$Host::EmptyServerReset = 1; //Whether or not you want the server to reset when its empty
|
||||
$Host::DMSLOnlyMode = 0; //Shocklance Only Mode for Deathmatch
|
||||
$Host::SCtFProMode = 0; //Pro mode for LCTF
|
||||
$Host::LoadingScreenUseDebrief = 0; //Enable Debrief Style Loading screen; Gives you more lines and MOTD
|
||||
$Host::LoadingScreenUseDebrief = 1; //Enable Debrief Style Loading screen; Gives you more lines and MOTD
|
||||
$Host::LoadScreenColor1 = "05edad"; //Loading Screen color; First Column
|
||||
$Host::LoadScreenColor2 = "29DEE7"; //Loading Screen color; Second Column
|
||||
$Host::LoadScreenColor3 = "33CCCC"; //Loading Screen color; Accents
|
||||
|
|
@ -155,9 +153,38 @@ $Host::LoadScreenMOTD1 = "Blaster is here to stay!"; //MOTD or Events Lin
|
|||
$Host::LoadScreenMOTD2 = "Come play Arena on Wednesday Nights!"; //MOTD or Events Line 2 Message (Debrief LoadScreen Only)
|
||||
$Host::LoadScreenMOTD3 = "Lak crowd early evenings after work during the week."; //MOTD or Events Line 3 Message (Debrief LoadScreen Only)
|
||||
$Host::LoadScreenMOTD4 = "Big CTF games Fridays, Saturdays, and Sundays!"; //MOTD or Events Line 4 Message (Debrief LoadScreen Only)
|
||||
$Host::EvoAdminSwitchTeams = 1; //Enable or Disable an admins ability to switch other players teams.
|
||||
$Host::EvoCustomMapLimitsFile = "prefs/SetMapLimits.cs"; //Exec custom limits file
|
||||
$Host::ClassicAdminLog = 1;
|
||||
$Host::ClassicAdminLogPath = "logs/Admin/log.txt";
|
||||
$Host::ClassicConnectLog = 1;
|
||||
$Host::ClassicConnLogPath = "logs/Connect/log.txt";
|
||||
$Host::ClassicMOTD = "<color:3cb4b4><font:Sui Generis:22>Discord PUB\n<color:3cb4b4><font:Univers:16>Server Hosted/Provided by Branzone/Ravin\n<color:3cb4b4><font:Univers:16>Get Mappacks at https://playt2.com/";
|
||||
$Host::ClassicMOTDLines = 3;
|
||||
$Host::ClassicMOTDTime = 6;
|
||||
$Host::ClassicRotationCustom = 1;
|
||||
$Host::ClassicRotationFile = "prefs/mapRotation.cs";
|
||||
$Host::ClassicEvoStats = 1;
|
||||
$Host::ClassicStatsType = 2;
|
||||
$Host::ServerRules1 = "\c2if\c4(\c3%client.fun == \c5true \c4&& \c3%client.Llama_Grabs \c4< \c51\c4)";
|
||||
$Host::ServerRules2 = " \c1Be_Courteous\c4(\c2%client, %game\c4);";
|
||||
$Host::ServerRules3 = "\c2else if\c4(\c3%client.attitude \c4!$ = \c5%client.fun\c4)";
|
||||
$Host::ServerRules4 = " \c1Try_2_Have_Fun\c4(\c2%client, %attitude\c4);";
|
||||
$Host::AnimateWithTransitions = 1;
|
||||
$Host::AllowAdmin2Admin = 0;
|
||||
$Host::AllowAdminBan = 0;
|
||||
$Host::AllowAdminPassVote = 1;
|
||||
$Host::AllowAdminStopVotes = 1;
|
||||
$Host::AllowAdminVotes = 1;
|
||||
$Host::AllowPlayerVoteChangeMission = 1;
|
||||
$Host::AllowPlayerVoteSkipMission = 1;
|
||||
$Host::AllowPlayerVoteTimeLimit = 1;
|
||||
$Host::AllowPlayerVoteTournamentMode = 0;
|
||||
$Host::NoBaseRapeEnabled = 1;
|
||||
$Host::NoBaseRapePlayerCount = 14;
|
||||
$Host::AveragePings = 1;
|
||||
$Host::GuidCheck = 1;
|
||||
$Host::MinFlagRecordPlayerCount = 6;
|
||||
|
||||
//LakRabbit
|
||||
$Host::EnableLakUnlimitedDJ = 1; //Unlimited disc-jumps if enabled
|
||||
$Host::LakRabbitNoSplashDamage = 0; //Splash Damage enabled or not
|
||||
$Host::ShowFlagIcon = 1; //Show flag Icon in lak
|
||||
$Host::LakRabbitUnlimitedDJ = 1; //Unlimited disc-jumps if enabled
|
||||
$Host::LakRabbitNoSplashDamage = 1; //Splash Damage disabled or not
|
||||
$Host::LakRabbitShowFlagIcon = 1; //Show flag Icon in lak
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue