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