From 74df9999bb03a43c455bbee424eaf90b6866c731 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Wed, 15 Dec 2021 19:26:39 -0800 Subject: [PATCH] Grief: add random map rotation --- README.md | 1 + scripts/zm/main/_zm_reimagined_zgrief.gsc | 26 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/README.md b/README.md index 427be452..be1d0974 100644 --- a/README.md +++ b/README.md @@ -271,4 +271,5 @@ * Enemies remaining text is removed when new text is displayed * Added new audio when enemy players bleed out * Round reset properly restores dual wield weapon left clip ammo, alternative weapon ammo, and equipment +* Random map rotation * 20000 health Brutus \ No newline at end of file diff --git a/scripts/zm/main/_zm_reimagined_zgrief.gsc b/scripts/zm/main/_zm_reimagined_zgrief.gsc index 82c4b3f2..f8f93854 100644 --- a/scripts/zm/main/_zm_reimagined_zgrief.gsc +++ b/scripts/zm/main/_zm_reimagined_zgrief.gsc @@ -47,6 +47,7 @@ init() level thread round_start_wait(5, true); level thread unlimited_zombies(); level thread remove_status_icons_on_end_game(); + level thread random_map_rotation(); //level thread spawn_bots(7); } @@ -1931,6 +1932,31 @@ remove_status_icons_on_end_game() } } +random_map_rotation() +{ + level waittill("end_game"); + + rotation_data = spawnStruct(); + rotation_data.location = array("town", "farm", "transit", "cellblock", "street"); + rotation_data.mapname = array("zm_transit", "zm_transit", "zm_transit", "zm_prison", "zm_buried"); + + // remove current map + for(i = 0; i < rotation_data.location.size; i++) + { + if(level.scr_zm_map_start_location == rotation_data.location[i] && level.script == rotation_data.mapname[i]) + { + arrayRemoveIndex(rotation_data.location, i); + arrayRemoveIndex(rotation_data.mapname, i); + break; + } + } + + num = randomInt(rotation_data.location.size); + rotation_string = va( "exec zm_%s_%s.cfg map %s", "grief", rotation_data.location[num], rotation_data.mapname[num] ); + setDvar( "sv_maprotation", rotation_string ); + setDvar( "sv_maprotationCurrent", rotation_string ); +} + spawn_bots(num) { level waittill( "connected", player );