GetRandomMaps changes

RandomMaps are pulled from rotation
zDarkTigerMapRotation removed for now
Fallback to Evo maprotation
This commit is contained in:
ChocoTaco 2019-12-08 12:10:17 -05:00
parent cf5440b41c
commit ac9bb2fd1b
3 changed files with 125 additions and 511 deletions

View file

@ -10,140 +10,105 @@
// This file is present
$GetRandomMapsLoaded = true;
// Map pool
//
// CTF
//
// 1-5
$RandomMapPick1 = "SmallCrossing"; $RandomMapPick2 = "OasisIntensity"; $RandomMapPick3 = "Blink"; $RandomMapPick4 = "SmallTimeCTF"; $RandomMapPick5 = "ArenaDome";
// 6-10
$RandomMapPick6 = "HighOctane"; $RandomMapPick7 = "S5_Damnation"; $RandomMapPick8 = "TWL_Feign"; $RandomMapPick9 = "TWL2_Skylight"; $RandomMapPick10 = "Prismatic";
// 11-15
$RandomMapPick11 = "Dire"; $RandomMapPick12 = "TWL2_JaggedClaw"; $RandomMapPick13 = "TWL2_Hildebrand"; $RandomMapPick14 = "TWL_WilderZone"; $RandomMapPick15 = "TWL_Stonehenge";
// 16-20
$RandomMapPick16 = "TWL2_Ocular"; $RandomMapPick17 = "S8_Opus"; $RandomMapPick18 = "Mirage"; $RandomMapPick19 = "DangerousCrossing_nef"; $RandomMapPick20 = "S5_Massive";
// 21-25
$RandomMapPick21 = "TheFray"; $RandomMapPick22 = "RoundTheMountain"; $RandomMapPick23 = "S5_Mordacity"; $RandomMapPick24 = "TWL2_CanyonCrusadeDeluxe"; $RandomMapPick25 = "Signal";
// 26-30
$RandomMapPick26 = "S8_Cardiac"; $RandomMapPick27 = "CirclesEdge"; $RandomMapPick28 = "S5_Icedance"; $RandomMapPick29 = "Bulwark"; $RandomMapPick30 = "Discord";
// 31-35
$RandomMapPick31 = "MoonDance"; $RandomMapPick32 = "Rollercoaster_nef"; $RandomMapPick33 = "Logans_Run"; $RandomMapPick34 = "TWL_BeachBlitz"; $RandomMapPick35 = "TWL2_FrozenGlory";
// 36-40
$RandomMapPick36 = "CircleofStones"; $RandomMapPick37 = "TitanV"; $RandomMapPick38 = "TWL_Katabatic"; $RandomMapPick39 = "TWL2_Magnum"; $RandomMapPick40 = "Fenix";
//
// LakRabbit
//
// 1-3
$LakRandomMapPick1 = "VaubanLak"; $LakRandomMapPick2 = "MiniSunDried"; $LakRandomMapPick3 = "TitaniaLak";
// 4-6
$LakRandomMapPick4 = "DesertofDeathLak"; $LakRandomMapPick5 = "Sundance"; $LakRandomMapPick6 = "SunDriedLak";
// 7-9
$LakRandomMapPick7 = "SkinnyDipLak"; $LakRandomMapPick8 = "LushLak"; $LakRandomMapPick9 = "InfernusLak";
// 10-12
$LakRandomMapPick10 = "Arrakis"; $LakRandomMapPick11 = "BoxLak"; $LakRandomMapPick12 = "TreasureIslandLak";
// 13-15
$LakRandomMapPick13 = "Raindance_nefLak"; $LakRandomMapPick14 = "SaddiesHill"; $LakRandomMapPick15 = "TWL_BeachBlitzLak";
// 16-18
$LakRandomMapPick16 = "PhasmaDustLak"; $LakRandomMapPick17 = "TibbawLak"; $LakRandomMapPick18 = "HavenLak";
// 19-21
$LakRandomMapPick19 = "Crater71Lak"; $LakRandomMapPick20 = "SolsDescentLak"; $LakRandomMapPick21 = "FrozenFuryLak";
// 22-24
$LakRandomMapPick22 = "CankerLak"; $LakRandomMapPick23 = "S8_GeothermalLak"; $LakRandomMapPick24 = "DustRunLak";
//
// LCTF
//
// 1-5
$LCTFRandomMapPick1 = "BastardForgeLT"; $LCTFRandomMapPick2 = "FirestormLT"; $LCTFRandomMapPick3 = "DangerousCrossingLT"; $LCTFRandomMapPick4 = "S5_DamnationLT"; $LCTFRandomMapPick5 = "TenebrousCTF";
// 6-10
$LCTFRandomMapPick6 = "SmallCrossingLT"; $LCTFRandomMapPick7 = "CirclesEdgeLT"; $LCTFRandomMapPick8 = "TheFray"; $LCTFRandomMapPick9 = "SignalLT"; $LCTFRandomMapPick10 = "StarFallLT";
// 11-15
$LCTFRandomMapPick11 = "DireLT"; $LCTFRandomMapPick12 = "S5_Icedance"; $LCTFRandomMapPick13 = "TWL2_HildebrandLT"; $LCTFRandomMapPick14 = "TWL2_CanyonCrusadeDeluxeLT"; $LCTFRandomMapPick15 = "TWL2_FrozenHopeLT";
// 16-20
$LCTFRandomMapPick16 = "RoundTheMountainLT"; $LCTFRandomMapPick17 = "Blink"; $LCTFRandomMapPick18 = "TWL2_SkylightLT"; $LCTFRandomMapPick19 = "TWL_BeachBlitzLT"; $LCTFRandomMapPick20 = "S5_MassiveLT";
// 21-25
$LCTFRandomMapPick21 = "S5_Mimicry"; $LCTFRandomMapPick22 = "S5_SilenusLT"; $LCTFRandomMapPick23 = "S5_Mordacity"; $LCTFRandomMapPick24 = "S5_Woodymyrk"; $LCTFRandomMapPick25 = "S8_Cardiac";
// 26-30
$LCTFRandomMapPick26 = "S8_Opus"; $LCTFRandomMapPick27 = "TWL2_Celerity"; $LCTFRandomMapPick28 = "TWL2_Crevice"; $LCTFRandomMapPick29 = "S5_HawkingHeat"; $LCTFRandomMapPick30 = "TWL2_MidnightMayhemDeluxe";
// 31-35
$LCTFRandomMapPick31 = "Discord"; $LCTFRandomMapPick32 = "Bulwark"; $LCTFRandomMapPick33 = "ArenaDome"; $LCTFRandomMapPick34 = "SmallTimeLT"; $LCTFRandomMapPick35 = "RaindanceLT";
// 36-40
$LCTFRandomMapPick36 = "TWL_OsIris"; $LCTFRandomMapPick37 = "TWL_Damnation"; $LCTFRandomMapPick38 = "Headstone"; $LCTFRandomMapPick39 = "BeggarsRunLT"; $LCTFRandomMapPick40 = "Berlard";
// 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 )
{
switch$($CurrentMissionType)
%cyclecount = 1;
for(%i = 0; %i < 8; %i++)
{
case "CTF":
//Get random numbers
%RandomPick1 = getRandom(1,5);
%RandomPick2 = getRandom(6,10);
%RandomPick3 = getRandom(11,15);
%RandomPick4 = getRandom(16,20);
%RandomPick5 = getRandom(21,25);
%RandomPick6 = getRandom(26,30);
%RandomPick7 = getRandom(31,35);
%RandomPick8 = getRandom(36,40);
//Deduction code
$SetNextMissionMapSlot1 = $RandomMapPick[%RandomPick1];
$SetNextMissionMapSlot2 = $RandomMapPick[%RandomPick2];
$SetNextMissionMapSlot3 = $RandomMapPick[%RandomPick3];
$SetNextMissionMapSlot4 = $RandomMapPick[%RandomPick4];
$SetNextMissionMapSlot5 = $RandomMapPick[%RandomPick5];
$SetNextMissionMapSlot6 = $RandomMapPick[%RandomPick6];
$SetNextMissionMapSlot7 = $RandomMapPick[%RandomPick7];
$SetNextMissionMapSlot8 = $RandomMapPick[%RandomPick8];
case "LakRabbit":
//Get random numbers
%LakRandomPick1 = getRandom(1,3);
%LakRandomPick2 = getRandom(4,6);
%LakRandomPick3 = getRandom(7,9);
%LakRandomPick4 = getRandom(10,12);
%LakRandomPick5 = getRandom(13,15);
%LakRandomPick6 = getRandom(16,18);
%LakRandomPick7 = getRandom(19,21);
%LakRandomPick8 = getRandom(22,24);
//Deduction code
$SetNextMissionMapSlot1 = $LakRandomMapPick[%LakRandomPick1];
$SetNextMissionMapSlot2 = $LakRandomMapPick[%LakRandomPick2];
$SetNextMissionMapSlot3 = $LakRandomMapPick[%LakRandomPick3];
$SetNextMissionMapSlot4 = $LakRandomMapPick[%LakRandomPick4];
$SetNextMissionMapSlot5 = $LakRandomMapPick[%LakRandomPick5];
$SetNextMissionMapSlot6 = $LakRandomMapPick[%LakRandomPick6];
$SetNextMissionMapSlot7 = $LakRandomMapPick[%LakRandomPick7];
$SetNextMissionMapSlot8 = $LakRandomMapPick[%LakRandomPick8];
case "SCtF":
//Get random numbers
%LCTFRandomPick1 = getRandom(1,5);
%LCTFRandomPick2 = getRandom(6,10);
%LCTFRandomPick3 = getRandom(11,15);
%LCTFRandomPick4 = getRandom(16,20);
%LCTFRandomPick5 = getRandom(21,25);
%LCTFRandomPick6 = getRandom(26,30);
%LCTFRandomPick7 = getRandom(31,35);
%LCTFRandomPick8 = getRandom(36,40);
//Deduction code
$SetNextMissionMapSlot1 = $LCTFRandomMapPick[%LCTFRandomPick1];
$SetNextMissionMapSlot2 = $LCTFRandomMapPick[%LCTFRandomPick2];
$SetNextMissionMapSlot3 = $LCTFRandomMapPick[%LCTFRandomPick3];
$SetNextMissionMapSlot4 = $LCTFRandomMapPick[%LCTFRandomPick4];
$SetNextMissionMapSlot5 = $LCTFRandomMapPick[%LCTFRandomPick5];
$SetNextMissionMapSlot6 = $LCTFRandomMapPick[%LCTFRandomPick6];
$SetNextMissionMapSlot7 = $LCTFRandomMapPick[%LCTFRandomPick7];
$SetNextMissionMapSlot8 = $LCTFRandomMapPick[%LCTFRandomPick8];
case "DM":
$SetNextMissionMapSlot1 = "RaspDM";
$SetNextMissionMapSlot2 = "EntombedDM";
$SetNextMissionMapSlot3 = "IceDomeDM";
$SetNextMissionMapSlot4 = "LiveBaitDM";
$SetNextMissionMapSlot5 = "ArenaDomeDM";
$SetNextMissionMapSlot6 = "VulcansWrathDM";
$SetNextMissionMapSlot7 = "RampartsDM";
$SetNextMissionMapSlot8 = "ShrineDM";
$SetNextMissionMapSlot[%cyclecount] = getRandomMap();
%cyclecount++;
}
}