mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-06-21 04:44:02 +00:00
Merge branch 'NoEvo'
This commit is contained in:
commit
097460fb98
10 changed files with 432 additions and 173 deletions
20
Classic/scripts/autoexec/Autobalance.cs
Normal file → Executable file
20
Classic/scripts/autoexec/Autobalance.cs
Normal file → Executable file
|
|
@ -61,9 +61,6 @@ function Autobalance( %game )
|
|||
//Select lower half of team rank as canidates for team change
|
||||
if(!$Autobalance::UseAllMode)
|
||||
{
|
||||
//Reset clients canidate var
|
||||
ResetABClients();
|
||||
|
||||
$Autobalance::Max = mFloor($TeamRank[$BigTeam, count]/2);
|
||||
for(%i = $Autobalance::Max; %i < $TeamRank[$BigTeam, count]; %i++)
|
||||
{
|
||||
|
|
@ -127,14 +124,17 @@ function DefaultGame::gameOver(%game)
|
|||
{
|
||||
Parent::gameOver(%game);
|
||||
|
||||
//Reset Autobalance
|
||||
$BigTeam = "";
|
||||
|
||||
//Reset all clients canidate var
|
||||
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
if($CurrentMissionType $= "CTF" || $CurrentMissionType $= "SCtF")
|
||||
{
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%client.abCanidate = false;
|
||||
//Reset Autobalance
|
||||
$BigTeam = "";
|
||||
|
||||
//Reset all clients canidate var
|
||||
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%i);
|
||||
%client.abCanidate = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
111
Classic/scripts/autoexec/EvoStats.cs
Normal file → Executable file
111
Classic/scripts/autoexec/EvoStats.cs
Normal file → Executable file
|
|
@ -258,7 +258,7 @@ function handleMAStat(%data, %projectile, %targetObject, %modifier, %position, %
|
|||
// %distance = mFloor(VectorDist(%position, %projectile.sourceObject.getWorldBoxCenter()));
|
||||
|
||||
// // Evolution Method
|
||||
%distance = mFloor(VectorDist(%position, %projectile.initialPosition));
|
||||
%distance = mFloor(VectorDist(%position, %projectile.initialPosition));
|
||||
|
||||
// failsafe
|
||||
if(%victim $= "" || %killer $= "")
|
||||
|
|
@ -276,77 +276,74 @@ function handleMAStat(%data, %projectile, %targetObject, %modifier, %position, %
|
|||
|
||||
// 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);
|
||||
%raycast = containerRaycast(%position, vectorAdd(%position, "0 0 -10"), $TypeMasks::ForceFieldObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::StaticObjectType | $TypeMasks::TerrainObjectType, %targetObject);
|
||||
if(!isObject(firstWord(%raycast))) // We've got something...
|
||||
{
|
||||
if(%projectileType $= "DiscProjectile")
|
||||
switch$(%projectileType)
|
||||
{
|
||||
%killer.midairs++;
|
||||
case DiscProjectile:
|
||||
%killer.midairs++;
|
||||
|
||||
if( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) )
|
||||
bottomPrint(%killer, "Midair Disk (" @ %killer.midairs @ ")! Distance is " @ %distance @ " meters.", 3);
|
||||
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@")");
|
||||
// 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(%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(%distance > $stats::ma_maxdistance)
|
||||
{
|
||||
$stats::ma_maxdistance = %distance;
|
||||
$stats::ma_maxdistanceclient = getTaggedString(%killer.name);
|
||||
}
|
||||
case PlasmaBolt:
|
||||
%killer.PlaMA++;
|
||||
|
||||
if ( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) )
|
||||
bottomPrint(%killer, "Midair Plasma (" @ %killer.PlaMA @ ")! Distance is " @ %distance @ " meters.", 3);
|
||||
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@")");
|
||||
// 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(%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(%distance > $stats::PlaMA_maxdistance)
|
||||
{
|
||||
$stats::PlaMA_maxdistance = %distance;
|
||||
$stats::PlaMA_maxdistanceclient = getTaggedString(%killer.name);
|
||||
}
|
||||
case EnergyBolt:
|
||||
%killer.blaMA++;
|
||||
|
||||
if( ( %killer.showMA $= "" ) || ( %killer.showMA == 1 ) )
|
||||
bottomPrint(%killer, "Midair Blaster (" @ %killer.blaMA @ ")! Distance is " @ %distance @ " meters.", 3);
|
||||
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@")");
|
||||
// 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(%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);
|
||||
}
|
||||
if(%distance > $stats::BlaMA_maxdistance)
|
||||
{
|
||||
$stats::BlaMA_maxdistance = %distance;
|
||||
$stats::BlaMA_maxdistanceclient = getTaggedString(%killer.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
Classic/scripts/autoexec/GetTeamCounts.cs
Normal file → Executable file
8
Classic/scripts/autoexec/GetTeamCounts.cs
Normal file → Executable file
|
|
@ -54,13 +54,7 @@ function GetTeamCounts(%game)
|
|||
$AllPlayerCount = $HostGamePlayerCount;
|
||||
|
||||
//Observers
|
||||
$Observers = 0;
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if(%cl.team $= 0)
|
||||
$Observers++;
|
||||
}
|
||||
$Observers = $HostGamePlayerCount - ($TeamRank[1, count] + $TeamRank[2, count]);
|
||||
|
||||
//echo("$PlayerCount[0] " @ $HostGamePlayerCount - ($TeamRank[1, count] + $TeamRank[2, count]));
|
||||
//echo("$PlayerCount[1] " @ $TeamRank[1, count]);
|
||||
|
|
|
|||
2
Classic/scripts/autoexec/MidAirDetRep.cs
Normal file → Executable file
2
Classic/scripts/autoexec/MidAirDetRep.cs
Normal file → Executable file
|
|
@ -131,7 +131,7 @@ function maDirect(%client)// tests for direct hit with aoe weapons
|
|||
|
||||
function maRayTestDis(%targetObject)// tests for height of target
|
||||
{
|
||||
%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType;
|
||||
%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::VehicleObjectType;
|
||||
%rayStart = %targetObject.getWorldBoxCenter();
|
||||
%rayEnd = VectorAdd(%rayStart,"0 0" SPC -5000);
|
||||
%ray = ContainerRayCast(%rayStart, %rayEnd, %mask, %targetObject);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ function serverCmdEndThrowCount(%client, %data)
|
|||
%throwScale = %throwStrength / 2;
|
||||
%client.player.throwStrength = %throwScale;
|
||||
|
||||
%client.player.throwStart = 5; //was 0
|
||||
%client.player.throwStart = 2; //was 0
|
||||
}
|
||||
|
||||
//Tank UE code by Keen
|
||||
|
|
@ -154,9 +154,9 @@ function stationTrigger::onEnterTrigger(%data, %obj, %colObj)
|
|||
//OG Blaster Buff
|
||||
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC)
|
||||
{
|
||||
//Takes 10 blaster shots to kill a heavy, 13 normal.
|
||||
//Takes 11 blaster shots to kill a heavy, 13 normal.
|
||||
if(%targetObject.client.armor $= "Heavy" && %damageType $= $DamageType::Blaster)
|
||||
%amount *= 1.3;
|
||||
%amount *= 1.15;
|
||||
|
||||
Parent::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec, %mineSC);
|
||||
}
|
||||
|
|
@ -291,6 +291,13 @@ function VehicleData::createPositionMarker(%data, %obj)
|
|||
return %marker;
|
||||
}
|
||||
|
||||
//Conc Throw (Almost Normal Grenades) 1500 Normal
|
||||
function ConcussionGrenadeThrown::onThrow(%this, %gren)
|
||||
{
|
||||
AIGrenadeThrown(%gren);
|
||||
%gren.detThread = schedule(1800, %gren, "detonateGrenade", %gren); // Was 2000
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Prevent package from being activated if it is already
|
||||
|
|
|
|||
4
Classic/scripts/autoexec/zDarkTigerStats.cs
Normal file → Executable file
4
Classic/scripts/autoexec/zDarkTigerStats.cs
Normal file → Executable file
|
|
@ -5759,7 +5759,7 @@ function GameConnection::dtMessage(%this,%message,%sfx,%bypass){
|
|||
|
||||
function rayTest(%targetObject,%dis){
|
||||
if(isObject(%targetObject)){
|
||||
%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType;
|
||||
%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::VehicleObjectType;
|
||||
%rayStart = %targetObject.getWorldBoxCenter();
|
||||
%rayEnd = VectorAdd(%rayStart,"0 0" SPC ((%dis+1.15) * -1));
|
||||
%ground = !ContainerRayCast(%rayStart, %rayEnd, %mask, %targetObject);
|
||||
|
|
@ -5770,7 +5770,7 @@ function rayTest(%targetObject,%dis){
|
|||
}
|
||||
function rayTestDis(%targetObject){
|
||||
if(isObject(%targetObject)){
|
||||
%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType;
|
||||
%mask = $TypeMasks::StaticShapeObjectType | $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType | $TypeMasks::ForceFieldObjectType | $TypeMasks::VehicleObjectType;
|
||||
%rayStart = %targetObject.getWorldBoxCenter();
|
||||
%rayEnd = VectorAdd(%rayStart,"0 0" SPC -5000);
|
||||
%ray = ContainerRayCast(%rayStart, %rayEnd, %mask, %targetObject);
|
||||
|
|
|
|||
222
Classic/scripts/autoexec/zzDiscordBot.cs
Normal file → Executable file
222
Classic/scripts/autoexec/zzDiscordBot.cs
Normal file → Executable file
|
|
@ -4,13 +4,17 @@
|
|||
|
||||
//exec("scripts/autoexec/zzDiscordBot.cs");
|
||||
|
||||
$discordBot::AuthKey[0] = "";
|
||||
$discordBot::IP[0] = "";
|
||||
//note first channel is for monitoring
|
||||
$discordBot::discordCHID = "";
|
||||
$discordBot::IP = "";
|
||||
$discordBot::reconnectTimeout = 3 * 60000;
|
||||
$discordBot::AuthSet = 0;
|
||||
$discordBot::autoStart = 1;
|
||||
|
||||
|
||||
$discordBot::autoStart = 0;
|
||||
//used on the bot to help split thigns up
|
||||
$discordBot::cmdSplit = "%cmd%";
|
||||
$discordBot::cmdSubSplit = "%tab%";
|
||||
//These correspond with $discordBot::discordCHID
|
||||
$discordBot::monitorChannel = 1;
|
||||
$discordBot::serverFeed = 2;
|
||||
package discordPackage
|
||||
{
|
||||
|
||||
|
|
@ -25,11 +29,12 @@ package discordPackage
|
|||
function messageAll(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13)
|
||||
{
|
||||
parent::messageAll(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10, %a11, %a12, %a13);
|
||||
%type = getTaggedString(%msgType);
|
||||
%type = getTaggedString(%msgType);
|
||||
switch$(%type)
|
||||
{
|
||||
case "msgExplosionKill" or "msgSuicide" or "msgVehicleSpawnKill" or "msgVehicleCrash" or "msgVehicleKill" or "msgTurretSelfKill" or "msgTurretSelfKill" or "msgCTurretKill" or "msgTurretKill" or
|
||||
"msgSelfKill" or "msgOOBKill" or "msgCampKill" or "msgTeamKill" or "msgLavaKill" or "msgLightningKill" or "MsgRogueMineKill" or "MsgHeadshotKill" or "MsgRearshotKill" or "MsgLegitKill":
|
||||
"msgSelfKill" or "msgOOBKill" or "msgCampKill" or "msgTeamKill" or "msgLavaKill" or "msgLightningKill" or "MsgRogueMineKill" or "MsgHeadshotKill" or "MsgRearshotKill" or "MsgLegitKill" or
|
||||
"MsgClientJoin" or "MsgClientDrop":
|
||||
%message = getTaggedString(%msgString);
|
||||
%message = strreplace(%message,"%1",getTaggedString(%a1));
|
||||
%message = strreplace(%message,"%2",getTaggedString(%a2));
|
||||
|
|
@ -40,74 +45,13 @@ function messageAll(%msgType, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8
|
|||
%message = strreplace(%message,"%7",getTaggedString(%a7));
|
||||
%message = strreplace(%message,"%8",getTaggedString(%a8));
|
||||
%message = stripChars(%message, "\cp\co\c0\c6\c7\c8\c9");
|
||||
sendToDiscord(%message,2);
|
||||
}
|
||||
sendToDiscordEmote(%message, $discordBot::serverFeed);
|
||||
}
|
||||
if($missionName !$= $discordBot::cm && ClientGroup.getCount() > 2){
|
||||
sendToDiscordEmote("The mission changed to" SPC $missionName, $discordBot::serverFeed);
|
||||
$discordBot::cm = $missionName;
|
||||
}
|
||||
}
|
||||
|
||||
function discordBotProcess(%type, %var1, %var2, %var3, %var4, %var5, %var6)
|
||||
{
|
||||
//echo(%type SPC %var1 SPC %var2 SPC %var3 SPC %var4 SPC %var5 SPC %var6);
|
||||
|
||||
switch$ (%type)
|
||||
{
|
||||
case "flagCap":
|
||||
%game = %var1;
|
||||
%player = %var2;
|
||||
%flag = %player.holdingFlag;
|
||||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false);
|
||||
%msg = getTaggedString(%player.client.name) SPC "captured the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag. (Held:" SPC %held @ ")";
|
||||
case "touchEnemyFlag":
|
||||
%game = %var1;
|
||||
%player = %var2;
|
||||
%flag = %var3;
|
||||
if(!%player.flagTossWait)
|
||||
{
|
||||
%grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6);
|
||||
if(%flag.isHome)
|
||||
%msg = getTaggedString(%player.client.name) SPC "took the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag. (Speed:" SPC %grabspeed @ "Kph)";
|
||||
else if(!%flag.isHome)
|
||||
%msg = getTaggedString(%player.client.name) SPC "took the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag in the field. (Speed:" SPC %grabspeed @ "Kph)";
|
||||
}
|
||||
case "droppedFlag":
|
||||
%game = %var1;
|
||||
%player = %var2;
|
||||
%flag = %player.holdingFlag;
|
||||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false);
|
||||
%msg = getTaggedString(%player.client.name) SPC "dropped the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag. (Held:" SPC %held @ ")";
|
||||
case "flagReturn":
|
||||
%game = %var1;
|
||||
%flag = %var2;
|
||||
%player = %var3;
|
||||
if(%player !$= "")
|
||||
%msg = getTaggedString(%player.client.name) SPC "returned the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag.";
|
||||
else
|
||||
%msg = "The" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag was returned to base.";
|
||||
case "lakTouchFlag":
|
||||
%game = %var1;
|
||||
%player = %var2;
|
||||
%flag = %var3;
|
||||
if(!%player.client.flagDeny && %player.getState() !$= "Dead" && PlayingPlayers() > 1)
|
||||
%msg = getTaggedString(%player.client.name) SPC "has taken the flag.";
|
||||
case "lakMApoints":
|
||||
%sourceObject = %var1;
|
||||
%points = %var2;
|
||||
if(%points == 1)
|
||||
%s = "s";
|
||||
%hitType = %var3;
|
||||
%weapon = %var4;
|
||||
%distance = %var5;
|
||||
%vel = %var6;
|
||||
if(%points)
|
||||
%msg = getTaggedString(%sourceObject.client.name) SPC "receives" SPC %points @ %s SPC "points! [" @ %hitType SPC %weapon @ "] [Distance:" SPC %distance @ "] [Speed:" SPC %vel @ "]";
|
||||
}
|
||||
|
||||
if(%msg !$= "")
|
||||
{
|
||||
%msg = stripChars(%msg, "\cp\co\c0\c6\c7\c8\c9");
|
||||
sendToDiscord(%msg, 2);
|
||||
}
|
||||
}
|
||||
|
||||
function CTFGame::flagCap(%game, %player)
|
||||
{
|
||||
if(discord.lastState $= "Connected")
|
||||
|
|
@ -183,11 +127,11 @@ function dtEventLog(%log, %save)
|
|||
{
|
||||
parent::dtEventLog(%log, %save);
|
||||
if(discord.lastState $= "Connected")
|
||||
sendToDiscord(%log, 1);
|
||||
sendToDiscord(%log, $discordBot::monitorChannel);
|
||||
}
|
||||
function LogMessage(%client, %msg, %cat){
|
||||
if(discord.lastState $= "Connected")
|
||||
sendToDiscord("Message" SPC %client.nameBase SPC %msg, 1);
|
||||
sendToDiscord("Message" SPC %client.nameBase SPC %msg, $discordBot::monitorChannel);
|
||||
parent::LogMessage(%client, %msg, %cat);
|
||||
}
|
||||
|
||||
|
|
@ -195,18 +139,90 @@ function LogMessage(%client, %msg, %cat){
|
|||
|
||||
if(!isActivePackage(discordPackage))
|
||||
activatePackage(discordPackage);
|
||||
|
||||
|
||||
function discordBotProcess(%type, %var1, %var2, %var3, %var4, %var5, %var6)
|
||||
{
|
||||
//echo(%type SPC %var1 SPC %var2 SPC %var3 SPC %var4 SPC %var5 SPC %var6);
|
||||
|
||||
switch$ (%type)
|
||||
{
|
||||
case "flagCap":
|
||||
%game = %var1;
|
||||
%player = %var2;
|
||||
%flag = %player.holdingFlag;
|
||||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false);
|
||||
%msg = getTaggedString(%player.client.name) SPC "captured the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag. (Held:" SPC %held @ ")";
|
||||
case "touchEnemyFlag":
|
||||
%game = %var1;
|
||||
%player = %var2;
|
||||
%flag = %var3;
|
||||
if(!%player.flagTossWait)
|
||||
{
|
||||
%grabspeed = mFloor(VectorLen(setWord(%player.getVelocity(), 2, 0)) * 3.6);
|
||||
if(%flag.isHome)
|
||||
%msg = getTaggedString(%player.client.name) SPC "took the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag. (Speed:" SPC %grabspeed @ "Kph)";
|
||||
else if(!%flag.isHome)
|
||||
%msg = getTaggedString(%player.client.name) SPC "took the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag in the field. (Speed:" SPC %grabspeed @ "Kph)";
|
||||
}
|
||||
case "droppedFlag":
|
||||
%game = %var1;
|
||||
%player = %var2;
|
||||
%flag = %player.holdingFlag;
|
||||
%held = %game.formatTime(getSimTime() - %game.flagHeldTime[%flag], false);
|
||||
%msg = getTaggedString(%player.client.name) SPC "dropped the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag. (Held:" SPC %held @ ")";
|
||||
case "flagReturn":
|
||||
%game = %var1;
|
||||
%flag = %var2;
|
||||
%player = %var3;
|
||||
if(%player !$= "")
|
||||
%msg = getTaggedString(%player.client.name) SPC "returned the" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag.";
|
||||
else
|
||||
%msg = "The" SPC getTaggedString(%game.getTeamName(%flag.team)) SPC "flag was returned to base.";
|
||||
case "lakTouchFlag":
|
||||
%game = %var1;
|
||||
%player = %var2;
|
||||
%flag = %var3;
|
||||
if(!%player.client.flagDeny && %player.getState() !$= "Dead" && PlayingPlayers() > 1)
|
||||
%msg = getTaggedString(%player.client.name) SPC "has taken the flag.";
|
||||
case "lakMApoints":
|
||||
%sourceObject = %var1;
|
||||
%points = %var2;
|
||||
if(%points == 1)
|
||||
%s = "s";
|
||||
%hitType = %var3;
|
||||
%weapon = %var4;
|
||||
%distance = %var5;
|
||||
%vel = %var6;
|
||||
if(%points)
|
||||
%msg = getTaggedString(%sourceObject.client.name) SPC "receives" SPC %points @ %s SPC "points! [" @ %hitType SPC %weapon @ "] [Distance:" SPC %distance @ "] [Speed:" SPC %vel @ "]";
|
||||
}
|
||||
|
||||
if(%msg !$= "")
|
||||
{
|
||||
%msg = stripChars(%msg, "\cp\co\c0\c6\c7\c8\c9");
|
||||
sendToDiscordEmote(%msg, $discordBot::serverFeed);
|
||||
}
|
||||
}
|
||||
function sendToDiscord(%msg,%channel)
|
||||
{
|
||||
if(isObject(discord) && %msg !$= "")
|
||||
{
|
||||
if(discord.lastState $= "Connected")
|
||||
{
|
||||
discord.send("MSG" SPC (%channel-1) SPC %msg @ "\r\n");
|
||||
discord.send("MSG" @ $discordBot::cmdSplit @ (%channel-1) @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
function sendToDiscordEmote(%msg,%channel)//emote filter will be applyed used in server feed
|
||||
{
|
||||
if(isObject(discord) && %msg !$= "")
|
||||
{
|
||||
if(discord.lastState $= "Connected")
|
||||
{
|
||||
discord.send("MSGE" @ $discordBot::cmdSplit @ (%channel-1) @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function discordCon(){
|
||||
if(discord.lastState !$= "Connected"){
|
||||
if(isEventPending($discordBot::reconnectEvent))
|
||||
|
|
@ -215,7 +231,7 @@ function discordCon(){
|
|||
discord.delete();
|
||||
new TCPObject(discord);
|
||||
discord.lastState = "Connecting";
|
||||
discord.connect($discordBot::IP[$discordBot::AuthSet]);
|
||||
discord.connect($discordBot::IP);
|
||||
}
|
||||
}
|
||||
function discordKill(){
|
||||
|
|
@ -246,7 +262,7 @@ function discord::onDNSResolved(%this){
|
|||
function discord::onConnected(%this){
|
||||
%this.lastState = "Connected";
|
||||
error(%this.lastState);
|
||||
discord.send("AUTH" SPC $discordBot::AuthKey[$discordBot::AuthSet] @ "\r\n");
|
||||
discord.send("AUTH" @ $discordBot::cmdSplit @ $discordBot::discordCHID @ $discordBot::cmdSplit @ $Host::GameName @ "\r\n");
|
||||
}
|
||||
|
||||
function discord::onDisconnect(%this){
|
||||
|
|
@ -265,9 +281,45 @@ function discord::onLine(%this, %line){
|
|||
//case "Discord":
|
||||
//messageAll( 'MsgDiscord', '\c3Discord: \c4%1 %2',getWord(%lineStrip,1),getWords(%lineStrip,2,getWordCount(%lineStrip) -1));
|
||||
case "PING":
|
||||
discord.send("PONG" @ "\r\n");
|
||||
case "PINGX":
|
||||
discord.send("PINGY" @ "\r\n");
|
||||
discord.send("PONG" @ $discordBot::cmdSplit @ "\r\n");
|
||||
case "PINGAVG":
|
||||
%min = 10000;
|
||||
%max = -10000;
|
||||
%lowCount = %lowPing = 0;
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
||||
%min = (%ping < %min) ? %ping : %min;
|
||||
%max = (%ping > %max) ? %ping : %max;
|
||||
if(%ping < 250){
|
||||
%lowCount++;
|
||||
%lowPing += %ping;
|
||||
}
|
||||
%pc++;
|
||||
%pingT += %ping;
|
||||
}
|
||||
%lowCount = (%lowCount == 0) ? 1 : %lowCount;
|
||||
if(!%pc){
|
||||
sendToDiscord("Ping AVG:" @ 0 SPC "Low Avg:" @ 0 SPC "Min:" @ 0 SPC "Max:" @ 0, $discordBot::monitorChannel);
|
||||
}
|
||||
else{
|
||||
%avg = mFloor(%pingT/%pc);
|
||||
%lavg = mFloor(%lowPing/%lowCount);
|
||||
sendToDiscord("Ping AVG:" @ %avg SPC "Low Avg:" @ %lavg SPC "Min:" @ %min SPC "Max:" @ %max, $discordBot::monitorChannel);
|
||||
}
|
||||
case "PINGLIST":
|
||||
if(isObject(discord) && discord.lastState $= "Connected"){
|
||||
%channel = 1;
|
||||
if(ClientGroup.getCount() > 0){
|
||||
for(%i = 0; %i < ClientGroup.getCount(); %i++){
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
%ping = %cl.isAIControlled() ? 0 : %cl.getPing();
|
||||
%msg = %cl.namebase @ $discordBot::cmdSubSplit @ %ping @ $discordBot::cmdSubSplit @ %i;
|
||||
discord.schedule(%i*32,"send","MSGSTACK" @ $discordBot::cmdSplit @ (%channel-1) @ $discordBot::cmdSplit @ %msg @ "\r\n");
|
||||
}
|
||||
discord.schedule((%i+1)*32,"send","PROCSTACK" @ $discordBot::cmdSplit @ (%channel-1) @ $discordBot::cmdSplit @ "msgList" @ "\r\n");
|
||||
}
|
||||
}
|
||||
default:
|
||||
error("Bad Command" SPC %line);
|
||||
}
|
||||
|
|
|
|||
3
Classic/scripts/defaultGame.cs
Normal file → Executable file
3
Classic/scripts/defaultGame.cs
Normal file → Executable file
|
|
@ -1833,7 +1833,8 @@ function DefaultGame::clientMissionDropReady(%game, %client)
|
|||
if(isEventPending(%client.okschedule))
|
||||
cancel(%client.okschedule);
|
||||
|
||||
%time = ($Host::KickObserverTimeout) + ($Host::KickObserverTimeout/2);
|
||||
%time = $Host::KickObserverTimeout;
|
||||
//%time = ($Host::KickObserverTimeout) + ($Host::KickObserverTimeout/2);
|
||||
//%minutes = %time / 60;
|
||||
//messageClient(%client, 'MsgNoObservers', '\c2You have %1 minutes to join the game or you will be kicked.', %minutes);
|
||||
|
||||
|
|
|
|||
14
Classic/scripts/server.cs
Normal file → Executable file
14
Classic/scripts/server.cs
Normal file → Executable file
|
|
@ -2047,13 +2047,13 @@ function serverCmdSet(%client, %type, %val)
|
|||
messageClient( %client, 'MsgAdmin', '\c2Unknown input value. 0 disables Fair Teams, 1 enables Fair Teams.' );
|
||||
}
|
||||
// z0dd - ZOD, 7/17/03. Allow super admins to issue console commands on the server.
|
||||
case "consolecmd":
|
||||
if($Host::ClassicAllowConsoleAccess)
|
||||
{
|
||||
eval(%val);
|
||||
messageClient( %client, 'MsgAdmin', '\c2Command %1 sent to server console.', %val );
|
||||
logEcho(%client.nameBase @ "Send the console command " @ %val @ " to the server.", 1);
|
||||
}
|
||||
// case "consolecmd":
|
||||
// if($Host::ClassicAllowConsoleAccess)
|
||||
// {
|
||||
// eval(%val);
|
||||
// messageClient( %client, 'MsgAdmin', '\c2Command %1 sent to server console.', %val );
|
||||
// logEcho(%client.nameBase @ "Send the console command " @ %val @ " to the server.", 1);
|
||||
// }
|
||||
|
||||
default:
|
||||
messageClient(%client, 'MsgValueFailed', '\c2No Changes. You did not specify a valid type.');
|
||||
|
|
|
|||
208
Classic/scripts/weapons/concussionGrenade.cs
Executable file
208
Classic/scripts/weapons/concussionGrenade.cs
Executable file
|
|
@ -0,0 +1,208 @@
|
|||
// grenade (thrown by hand) script
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
datablock EffectProfile(ConcussionGrenadeThrowEffect)
|
||||
{
|
||||
effectname = "weapons/grenade_throw";
|
||||
minDistance = 2.5;
|
||||
maxDistance = 2.5;
|
||||
};
|
||||
|
||||
datablock EffectProfile(ConcussionGrenadeSwitchEffect)
|
||||
{
|
||||
effectname = "weapons/generic_switch";
|
||||
minDistance = 2.5;
|
||||
maxDistance = 2.5;
|
||||
};
|
||||
|
||||
datablock EffectProfile(ConcussionGrenadeExplosionEffect)
|
||||
{
|
||||
effectname = "explosions/grenade_explode";
|
||||
minDistance = 10;
|
||||
maxDistance = 50;
|
||||
};
|
||||
|
||||
datablock AudioProfile(ConcussionGrenadeExplosionSound)
|
||||
{
|
||||
filename = "fx/weapons/grenade_explode.wav";
|
||||
description = AudioExplosion3d;
|
||||
preload = true;
|
||||
effect = ConcussionGrenadeExplosionEffect;
|
||||
};
|
||||
|
||||
// ------------------------------------------------------
|
||||
// z0dd - ZOD, 5/8/02. Duplicate datablock, waste of mem.
|
||||
//datablock AudioProfile(ConcussionGrenadeExplosionSound)
|
||||
//{
|
||||
// filename = "fx/weapons/grenade_explode.wav";
|
||||
// description = AudioExplosion3d;
|
||||
// preload = true;
|
||||
// effect = ConcussionGrenadeExplosionEffect;
|
||||
//};
|
||||
// ------------------------------------------------------
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Sparks
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ParticleData(ConcussionGrenadeSparks)
|
||||
{
|
||||
dragCoefficient = 1;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = 0.0;
|
||||
lifetimeMS = 500;
|
||||
lifetimeVarianceMS = 350;
|
||||
textureName = "special/bigSpark";
|
||||
colors[0] = "0.56 0.36 1.0 1.0";
|
||||
colors[1] = "0.56 0.36 1.0 1.0";
|
||||
colors[2] = "1.0 0.36 1.0 0.0";
|
||||
sizes[0] = 0.5;
|
||||
sizes[1] = 0.25;
|
||||
sizes[2] = 0.25;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData(ConcussionGrenadeSparkEmitter)
|
||||
{
|
||||
ejectionPeriodMS = 1;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 12;
|
||||
velocityVariance = 6.75;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 180;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 100;
|
||||
particles = "ConcussionGrenadeSparks";
|
||||
};
|
||||
|
||||
datablock ParticleData( ConcussionGrenadeCrescentParticle )
|
||||
{
|
||||
dragCoefficient = 2;
|
||||
gravityCoefficient = 0.0;
|
||||
inheritedVelFactor = 0.2;
|
||||
constantAcceleration = -0.0;
|
||||
lifetimeMS = 600;
|
||||
lifetimeVarianceMS = 000;
|
||||
textureName = "special/crescent3";
|
||||
colors[0] = "0.8 0.8 1.0 1.00";
|
||||
colors[1] = "0.8 0.5 1.0 0.20";
|
||||
colors[2] = "0.2 0.8 1.0 0.0";
|
||||
sizes[0] = 2.0;
|
||||
sizes[1] = 4.0;
|
||||
sizes[2] = 5.0;
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
};
|
||||
|
||||
datablock ParticleEmitterData( ConcussionGrenadeCrescentEmitter )
|
||||
{
|
||||
ejectionPeriodMS = 15;
|
||||
periodVarianceMS = 0;
|
||||
ejectionVelocity = 20;
|
||||
velocityVariance = 10.0;
|
||||
ejectionOffset = 0.0;
|
||||
thetaMin = 0;
|
||||
thetaMax = 80;
|
||||
phiReferenceVel = 0;
|
||||
phiVariance = 360;
|
||||
overrideAdvances = false;
|
||||
orientParticles = true;
|
||||
lifetimeMS = 200;
|
||||
particles = "ConcussionGrenadeCrescentParticle";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Shockwave
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ShockwaveData(ConcussionGrenadeShockwave)
|
||||
{
|
||||
width = 4.0;
|
||||
numSegments = 20;
|
||||
numVertSegments = 2;
|
||||
velocity = 5;
|
||||
acceleration = 10.0;
|
||||
lifetimeMS = 1000;
|
||||
height = 1.0;
|
||||
is2D = true;
|
||||
|
||||
texture[0] = "special/shockwave4";
|
||||
texture[1] = "special/gradient";
|
||||
texWrap = 6.0;
|
||||
|
||||
times[0] = 0.0;
|
||||
times[1] = 0.5;
|
||||
times[2] = 1.0;
|
||||
|
||||
colors[0] = "0.8 0.8 1.0 1.00";
|
||||
colors[1] = "0.8 0.5 1.0 0.20";
|
||||
colors[2] = "0.2 0.8 1.0 0.0";
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Explosion
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ExplosionData(ConcussionGrenadeExplosion)
|
||||
{
|
||||
soundProfile = ConcussionGrenadeExplosionSound;
|
||||
shockwave = ConcussionGrenadeShockwave;
|
||||
|
||||
emitter[0] = ConcussionGrenadeSparkEmitter;
|
||||
emitter[1] = ConcussionGrenadeCrescentEmitter;
|
||||
|
||||
shakeCamera = true;
|
||||
camShakeFreq = "4.0 5.0 4.5";
|
||||
camShakeAmp = "140.0 140.0 140.0";
|
||||
camShakeDuration = 1.0;
|
||||
camShakeRadius = 16.5; //was 15
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Item Data
|
||||
//--------------------------------------------------------------------------
|
||||
datablock ItemData(ConcussionGrenadeThrown)
|
||||
{
|
||||
shapeFile = "grenade.dts";
|
||||
mass = 0.7;
|
||||
elasticity = 0.2;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
maxDamage = 0.5;
|
||||
explosion = ConcussionGrenadeExplosion;
|
||||
damageRadius = 16.5; //was 15
|
||||
radiusDamageType = $DamageType::Grenade;
|
||||
kickBackStrength = 3500;
|
||||
|
||||
computeCRC = true;
|
||||
|
||||
};
|
||||
|
||||
datablock ItemData(ConcussionGrenade)
|
||||
{
|
||||
className = HandInventory;
|
||||
catagory = "Handheld";
|
||||
shapeFile = "grenade.dts";
|
||||
mass = 0.7;
|
||||
elasticity = 0.2;
|
||||
friction = 1;
|
||||
pickupRadius = 2;
|
||||
thrownItem = ConcussionGrenadeThrown;
|
||||
pickUpName = "some concussion grenades";
|
||||
isGrenade = true;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Functions:
|
||||
//--------------------------------------------------------------------------
|
||||
function ConcussionGrenadeThrown::onCollision( %data, %obj, %col )
|
||||
{
|
||||
// Do nothing...
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue