diff --git a/README.md b/README.md index 9f0fbe9f..e027231a 100644 --- a/README.md +++ b/README.md @@ -551,6 +551,7 @@ * Elevators and escape pod can be called without key * Escape pod can be used with any amount of players * Moved weapon locker to the downstairs fridge +* Zombies no longer spawn in an elevator when the elevator is within 1 floor of the spawn location * Zombies no longer spawn in the Upper Blue Highrise zone when in the Green Highrise zone * Zombies no longer spawn in the zone next to the Lower Orange Highrise zone when in the Lower Orange Highrise zone while the debris is closed * Fixed weapon model angle on upside down Mystery Box diff --git a/scripts/zm/replaced/zm_highrise_elevators.gsc b/scripts/zm/replaced/zm_highrise_elevators.gsc new file mode 100644 index 00000000..c6607383 --- /dev/null +++ b/scripts/zm/replaced/zm_highrise_elevators.gsc @@ -0,0 +1,87 @@ +#include maps\mp\_utility; +#include common_scripts\utility; +#include maps\mp\zombies\_zm_utility; +#include maps\mp\gametypes_zm\_hostmigration; +#include maps\mp\zm_highrise_utility; +#include maps\mp\zm_highrise_distance_tracking; +#include maps\mp\animscripts\zm_shared; +#include maps\mp\zombies\_zm_ai_basic; +#include maps\mp\zombies\_zm_ai_leaper; +#include maps\mp\zm_highrise_elevators; + +faller_location_logic() +{ + wait 1; + faller_spawn_points = getstructarray( "faller_location", "script_noteworthy" ); + leaper_spawn_points = getstructarray( "leaper_location", "script_noteworthy" ); + spawn_points = arraycombine( faller_spawn_points, leaper_spawn_points, 1, 0 ); + dist_check = 65536; + elevator_names = getarraykeys( level.elevators ); + elevators = []; + + for ( i = 0; i < elevator_names.size; i++ ) + elevators[i] = getent( "elevator_" + elevator_names[i] + "_body", "targetname" ); + + elevator_volumes = []; + elevator_volumes[elevator_volumes.size] = getent( "elevator_1b", "targetname" ); + elevator_volumes[elevator_volumes.size] = getent( "elevator_1c", "targetname" ); + elevator_volumes[elevator_volumes.size] = getent( "elevator_1d", "targetname" ); + elevator_volumes[elevator_volumes.size] = getent( "elevator_3a", "targetname" ); + elevator_volumes[elevator_volumes.size] = getent( "elevator_3b", "targetname" ); + elevator_volumes[elevator_volumes.size] = getent( "elevator_3c", "targetname" ); + elevator_volumes[elevator_volumes.size] = getent( "elevator_3d", "targetname" ); + level.elevator_volumes = elevator_volumes; + + while ( true ) + { + foreach ( point in spawn_points ) + { + should_block = 0; + + foreach ( elevator in elevators ) + { + if ( distancesquared( elevator getCentroid(), point.origin ) <= dist_check ) + should_block = 1; + } + + if ( should_block ) + { + point.is_enabled = 0; + point.is_blocked = 1; + continue; + } + + if ( isdefined( point.is_blocked ) && point.is_blocked ) + point.is_blocked = 0; + + if ( !isdefined( point.zone_name ) ) + continue; + + zone = level.zones[point.zone_name]; + + if ( zone.is_enabled && zone.is_active && zone.is_spawning_allowed ) + point.is_enabled = 1; + } + + players = get_players(); + + foreach ( volume in elevator_volumes ) + { + should_disable = 0; + + foreach ( player in players ) + { + if ( is_player_valid( player ) ) + { + if ( player istouching( volume ) ) + should_disable = 1; + } + } + + if ( should_disable ) + disable_elevator_spawners( volume, spawn_points ); + } + + wait 0.05; + } +} \ No newline at end of file diff --git a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc index 53f50c05..8d931075 100644 --- a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc +++ b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc @@ -9,6 +9,7 @@ #include scripts\zm\replaced\zm_highrise_gamemodes; #include scripts\zm\replaced\zm_highrise_classic; #include scripts\zm\replaced\zm_highrise_buildables; +#include scripts\zm\replaced\zm_highrise_elevators; #include scripts\zm\replaced\_zm_chugabud; #include scripts\zm\replaced\_zm_equip_springpad; #include scripts\zm\replaced\_zm_weap_slipgun; @@ -31,6 +32,7 @@ main() replaceFunc(maps\mp\zm_highrise_classic::insta_kill_player, scripts\zm\replaced\zm_highrise_classic::insta_kill_player); replaceFunc(maps\mp\zm_highrise_buildables::init_buildables, scripts\zm\replaced\zm_highrise_buildables::init_buildables); replaceFunc(maps\mp\zm_highrise_buildables::include_buildables, scripts\zm\replaced\zm_highrise_buildables::include_buildables); + replaceFunc(maps\mp\zm_highrise_elevators::faller_location_logic, scripts\zm\replaced\zm_highrise_elevators::faller_location_logic); replaceFunc(maps\mp\zombies\_zm_chugabud::chugabud_bleed_timeout, scripts\zm\replaced\_zm_chugabud::chugabud_bleed_timeout); replaceFunc(maps\mp\zombies\_zm_equip_springpad::springpadthink, scripts\zm\replaced\_zm_equip_springpad::springpadthink); replaceFunc(maps\mp\zombies\_zm_weap_slipgun::init, scripts\zm\replaced\_zm_weap_slipgun::init);