diff --git a/README.md b/README.md index 8ab6d8d7..1f9ae731 100644 --- a/README.md +++ b/README.md @@ -393,6 +393,9 @@ * Power switch automatically crafted * Pack-a-Punch automatically crafted * Navcard table automatically crafted +* Zombies spawn in the Warehouse zone when in the Outside Power Station zone before the Warehouse door is opened +* Zombies spawn in the Outside Power Station zone when in the Fog After Power Station zone +* Zombies spawn in the Warehouse zone when in the Fog After Power Station zone * Survival & Grief: power doors are buyable doors * Grief: added Ballistic Knife, Ray Gun, and Ray Gun Mark 2 to the Mystery Box * Fixed a zombie riser spawn point at Outside Power Station being too high above ground @@ -451,7 +454,7 @@ #### Cell Block * Added Smoke Grenades to the Mystery Box -* Added Richtofen's Head meat powerup model +* Added Richtofen Head meat powerup model ### Buried * Power automatically on diff --git a/scripts/zm/locs/zm_transit_loc_power.gsc b/scripts/zm/locs/zm_transit_loc_power.gsc index 884a0d61..c1c943e9 100644 --- a/scripts/zm/locs/zm_transit_loc_power.gsc +++ b/scripts/zm/locs/zm_transit_loc_power.gsc @@ -10,8 +10,6 @@ struct_init() { - replaceFunc(maps\mp\zombies\_zm_zonemgr::manage_zones, ::manage_zones); - scripts\zm\replaced\utility::register_perk_struct( "specialty_armorvest", "zombie_vending_jugg", ( 10952, 8055, -565 ), ( 0, 270, 0 ) ); scripts\zm\replaced\utility::register_perk_struct( "specialty_quickrevive", "zombie_vending_quickrevive", ( 11855, 7308, -758 ), ( 0, 220, 0 ) ); scripts\zm\replaced\utility::register_perk_struct( "specialty_fastreload", "zombie_vending_sleight", ( 11571, 7723, -757 ), ( 0, 0, 0 ) ); @@ -134,149 +132,4 @@ generatebuildabletarps() disable_zombie_spawn_locations() { level.zones["zone_trans_8"].is_spawning_allowed = 0; -} - -transit_loc_power_zone_init() -{ - flag_init( "always_on" ); - flag_set( "always_on" ); - - add_adjacent_zone("zone_pow", "zone_trans_8", "always_on"); - add_adjacent_zone( "zone_pow", "zone_pow_warehouse", "always_on" ); - add_adjacent_zone( "zone_trans_8", "zone_pow_warehouse", "always_on" ); - add_adjacent_zone( "zone_prr", "zone_pow", "OnPowDoorRR", 1 ); - add_adjacent_zone( "zone_pcr", "zone_prr", "OnPowDoorRR" ); - add_adjacent_zone( "zone_pcr", "zone_pow_warehouse", "OnPowDoorWH" ); -} - -manage_zones( initial_zone ) -{ - level.zone_manager_init_func = ::transit_loc_power_zone_init; - initial_zone = []; - initial_zone[0] = "zone_pow"; - initial_zone[1] = "zone_trans_8"; - - deactivate_initial_barrier_goals(); - zone_choke = 0; - spawn_points = maps\mp\gametypes_zm\_zm_gametype::get_player_spawns_for_gametype(); - for ( i = 0; i < spawn_points.size; i++ ) - { - spawn_points[ i ].locked = 1; - } - if ( isDefined( level.zone_manager_init_func ) ) - { - [[ level.zone_manager_init_func ]](); - } - - if ( isarray( initial_zone ) ) - { - for ( i = 0; i < initial_zone.size; i++ ) - { - zone_init( initial_zone[ i ] ); - enable_zone( initial_zone[ i ] ); - } - } - else - { - zone_init( initial_zone ); - enable_zone( initial_zone ); - } - setup_zone_flag_waits(); - zkeys = getarraykeys( level.zones ); - level.zone_keys = zkeys; - level.newzones = []; - for ( z = 0; z < zkeys.size; z++ ) - { - level.newzones[ zkeys[ z ] ] = spawnstruct(); - } - oldzone = undefined; - flag_set( "zones_initialized" ); - flag_wait( "begin_spawning" ); - while ( getDvarInt( "noclip" ) == 0 || getDvarInt( "notarget" ) != 0 ) - { - for( z = 0; z < zkeys.size; z++ ) - { - level.newzones[ zkeys[ z ] ].is_active = 0; - level.newzones[ zkeys[ z ] ].is_occupied = 0; - } - a_zone_is_active = 0; - a_zone_is_spawning_allowed = 0; - level.zone_scanning_active = 1; - z = 0; - while ( z < zkeys.size ) - { - zone = level.zones[ zkeys[ z ] ]; - newzone = level.newzones[ zkeys[ z ] ]; - if( !zone.is_enabled ) - { - z++; - continue; - } - if ( isdefined(level.zone_occupied_func ) ) - { - newzone.is_occupied = [[ level.zone_occupied_func ]]( zkeys[ z ] ); - } - else - { - newzone.is_occupied = player_in_zone( zkeys[ z ] ); - } - if ( newzone.is_occupied ) - { - newzone.is_active = 1; - a_zone_is_active = 1; - if ( zone.is_spawning_allowed ) - { - a_zone_is_spawning_allowed = 1; - } - if ( !isdefined(oldzone) || oldzone != newzone ) - { - level notify( "newzoneActive", zkeys[ z ] ); - oldzone = newzone; - } - azkeys = getarraykeys( zone.adjacent_zones ); - for ( az = 0; az < zone.adjacent_zones.size; az++ ) - { - if ( zone.adjacent_zones[ azkeys[ az ] ].is_connected && level.zones[ azkeys[ az ] ].is_enabled ) - { - level.newzones[ azkeys[ az ] ].is_active = 1; - if ( level.zones[ azkeys[ az ] ].is_spawning_allowed ) - { - a_zone_is_spawning_allowed = 1; - } - } - } - } - zone_choke++; - if ( zone_choke >= 3 ) - { - zone_choke = 0; - wait 0.05; - } - z++; - } - level.zone_scanning_active = 0; - for ( z = 0; z < zkeys.size; z++ ) - { - level.zones[ zkeys[ z ] ].is_active = level.newzones[ zkeys[ z ] ].is_active; - level.zones[ zkeys[ z ] ].is_occupied = level.newzones[ zkeys[ z ] ].is_occupied; - } - if ( !a_zone_is_active || !a_zone_is_spawning_allowed ) - { - if ( isarray( initial_zone ) ) - { - level.zones[ initial_zone[ 0 ] ].is_active = 1; - level.zones[ initial_zone[ 0 ] ].is_occupied = 1; - level.zones[ initial_zone[ 0 ] ].is_spawning_allowed = 1; - } - else - { - level.zones[ initial_zone ].is_active = 1; - level.zones[ initial_zone ].is_occupied = 1; - level.zones[ initial_zone ].is_spawning_allowed = 1; - } - } - [[ level.create_spawner_list_func ]]( zkeys ); - level.active_zone_names = maps\mp\zombies\_zm_zonemgr::get_active_zone_names(); - wait 1; - } } \ No newline at end of file diff --git a/scripts/zm/zm_transit/zm_transit_reimagined.gsc b/scripts/zm/zm_transit/zm_transit_reimagined.gsc index 43f1f8a6..596f2d22 100644 --- a/scripts/zm/zm_transit/zm_transit_reimagined.gsc +++ b/scripts/zm/zm_transit/zm_transit_reimagined.gsc @@ -40,6 +40,7 @@ main() replaceFunc(maps\mp\zombies\_zm_banking::bank_deposit_unitrigger, scripts\zm\replaced\_zm_banking::bank_deposit_unitrigger); replaceFunc(maps\mp\zombies\_zm_banking::bank_withdraw_unitrigger, scripts\zm\replaced\_zm_banking::bank_withdraw_unitrigger); replaceFunc(maps\mp\zombies\_zm_weapon_locker::triggerweaponslockerisvalidweaponpromptupdate, scripts\zm\replaced\_zm_weapon_locker::triggerweaponslockerisvalidweaponpromptupdate); + replaceFunc(maps\mp\zombies\_zm_zonemgr::manage_zones, ::manage_zones); grief_include_weapons(); electric_door_changes(); @@ -334,4 +335,208 @@ change_dvar_over_time(dvar, val, time, increment) } self setClientDvar(dvar, val); +} + +manage_zones( initial_zone ) +{ + level.zone_manager_init_func = ::transit_zone_init; + + deactivate_initial_barrier_goals(); + zone_choke = 0; + spawn_points = maps\mp\gametypes_zm\_zm_gametype::get_player_spawns_for_gametype(); + for ( i = 0; i < spawn_points.size; i++ ) + { + spawn_points[ i ].locked = 1; + } + if ( isDefined( level.zone_manager_init_func ) ) + { + [[ level.zone_manager_init_func ]](); + } + + if ( isarray( initial_zone ) ) + { + for ( i = 0; i < initial_zone.size; i++ ) + { + zone_init( initial_zone[ i ] ); + enable_zone( initial_zone[ i ] ); + } + } + else + { + zone_init( initial_zone ); + enable_zone( initial_zone ); + } + setup_zone_flag_waits(); + zkeys = getarraykeys( level.zones ); + level.zone_keys = zkeys; + level.newzones = []; + for ( z = 0; z < zkeys.size; z++ ) + { + level.newzones[ zkeys[ z ] ] = spawnstruct(); + } + oldzone = undefined; + flag_set( "zones_initialized" ); + flag_wait( "begin_spawning" ); + while ( getDvarInt( "noclip" ) == 0 || getDvarInt( "notarget" ) != 0 ) + { + for( z = 0; z < zkeys.size; z++ ) + { + level.newzones[ zkeys[ z ] ].is_active = 0; + level.newzones[ zkeys[ z ] ].is_occupied = 0; + } + a_zone_is_active = 0; + a_zone_is_spawning_allowed = 0; + level.zone_scanning_active = 1; + z = 0; + while ( z < zkeys.size ) + { + zone = level.zones[ zkeys[ z ] ]; + newzone = level.newzones[ zkeys[ z ] ]; + if( !zone.is_enabled ) + { + z++; + continue; + } + if ( isdefined(level.zone_occupied_func ) ) + { + newzone.is_occupied = [[ level.zone_occupied_func ]]( zkeys[ z ] ); + } + else + { + newzone.is_occupied = player_in_zone( zkeys[ z ] ); + } + if ( newzone.is_occupied ) + { + newzone.is_active = 1; + a_zone_is_active = 1; + if ( zone.is_spawning_allowed ) + { + a_zone_is_spawning_allowed = 1; + } + if ( !isdefined(oldzone) || oldzone != newzone ) + { + level notify( "newzoneActive", zkeys[ z ] ); + oldzone = newzone; + } + azkeys = getarraykeys( zone.adjacent_zones ); + for ( az = 0; az < zone.adjacent_zones.size; az++ ) + { + if ( zone.adjacent_zones[ azkeys[ az ] ].is_connected && level.zones[ azkeys[ az ] ].is_enabled ) + { + level.newzones[ azkeys[ az ] ].is_active = 1; + if ( level.zones[ azkeys[ az ] ].is_spawning_allowed ) + { + a_zone_is_spawning_allowed = 1; + } + } + } + } + zone_choke++; + if ( zone_choke >= 3 ) + { + zone_choke = 0; + wait 0.05; + } + z++; + } + level.zone_scanning_active = 0; + for ( z = 0; z < zkeys.size; z++ ) + { + level.zones[ zkeys[ z ] ].is_active = level.newzones[ zkeys[ z ] ].is_active; + level.zones[ zkeys[ z ] ].is_occupied = level.newzones[ zkeys[ z ] ].is_occupied; + } + if ( !a_zone_is_active || !a_zone_is_spawning_allowed ) + { + if ( isarray( initial_zone ) ) + { + level.zones[ initial_zone[ 0 ] ].is_active = 1; + level.zones[ initial_zone[ 0 ] ].is_occupied = 1; + level.zones[ initial_zone[ 0 ] ].is_spawning_allowed = 1; + } + else + { + level.zones[ initial_zone ].is_active = 1; + level.zones[ initial_zone ].is_occupied = 1; + level.zones[ initial_zone ].is_spawning_allowed = 1; + } + } + [[ level.create_spawner_list_func ]]( zkeys ); + level.active_zone_names = maps\mp\zombies\_zm_zonemgr::get_active_zone_names(); + wait 1; + } +} + +transit_zone_init() +{ + flag_init( "always_on" ); + flag_init( "init_classic_adjacencies" ); + flag_set( "always_on" ); + + if ( is_classic() ) + { + flag_set( "init_classic_adjacencies" ); + add_adjacent_zone( "zone_trans_2", "zone_trans_2b", "init_classic_adjacencies" ); + add_adjacent_zone( "zone_station_ext", "zone_trans_2b", "init_classic_adjacencies", 1 ); + add_adjacent_zone( "zone_town_west2", "zone_town_west", "init_classic_adjacencies" ); + add_adjacent_zone( "zone_town_south", "zone_town_church", "init_classic_adjacencies" ); + add_adjacent_zone( "zone_trans_pow_ext1", "zone_trans_7", "init_classic_adjacencies" ); + add_adjacent_zone( "zone_far", "zone_far_ext", "OnFarm_enter" ); + } + else + { + playable_area = getentarray( "player_volume", "script_noteworthy" ); + + foreach ( area in playable_area ) + { + add_adjacent_zone( "zone_station_ext", "zone_trans_2b", "always_on" ); + + if ( isdefined( area.script_parameters ) && area.script_parameters == "classic_only" ) + area delete(); + } + } + + add_adjacent_zone( "zone_pri2", "zone_station_ext", "OnPriDoorYar", 1 ); + add_adjacent_zone( "zone_pri2", "zone_pri", "OnPriDoorYar3", 1 ); + + if ( getdvar( "ui_zm_mapstartlocation" ) == "transit" ) + { + level thread disconnect_door_zones( "zone_pri2", "zone_station_ext", "OnPriDoorYar" ); + level thread disconnect_door_zones( "zone_pri2", "zone_pri", "OnPriDoorYar3" ); + } + + add_adjacent_zone( "zone_station_ext", "zone_pri", "OnPriDoorYar2" ); + add_adjacent_zone( "zone_roadside_west", "zone_din", "OnGasDoorDin" ); + add_adjacent_zone( "zone_roadside_west", "zone_gas", "always_on" ); + add_adjacent_zone( "zone_roadside_east", "zone_gas", "always_on" ); + add_adjacent_zone( "zone_roadside_east", "zone_gar", "OnGasDoorGar" ); + add_adjacent_zone( "zone_trans_diner", "zone_roadside_west", "always_on", 1 ); + add_adjacent_zone( "zone_trans_diner", "zone_gas", "always_on", 1 ); + add_adjacent_zone( "zone_trans_diner2", "zone_roadside_east", "always_on", 1 ); + add_adjacent_zone( "zone_gas", "zone_din", "OnGasDoorDin" ); + add_adjacent_zone( "zone_gas", "zone_gar", "OnGasDoorGar" ); + add_adjacent_zone( "zone_diner_roof", "zone_din", "OnGasDoorDin", 1 ); + add_adjacent_zone( "zone_amb_cornfield", "zone_cornfield_prototype", "always_on" ); + add_adjacent_zone( "zone_tow", "zone_bar", "always_on", 1 ); + add_adjacent_zone( "zone_bar", "zone_tow", "OnTowDoorBar", 1 ); + add_adjacent_zone( "zone_tow", "zone_ban", "OnTowDoorBan" ); + add_adjacent_zone( "zone_ban", "zone_ban_vault", "OnTowBanVault" ); + add_adjacent_zone( "zone_tow", "zone_town_north", "always_on" ); + add_adjacent_zone( "zone_town_north", "zone_ban", "OnTowDoorBan" ); + add_adjacent_zone( "zone_tow", "zone_town_west", "always_on" ); + add_adjacent_zone( "zone_tow", "zone_town_south", "always_on" ); + add_adjacent_zone( "zone_town_south", "zone_town_barber", "always_on", 1 ); + add_adjacent_zone( "zone_tow", "zone_town_east", "always_on" ); + add_adjacent_zone( "zone_town_east", "zone_bar", "OnTowDoorBar" ); + add_adjacent_zone( "zone_tow", "zone_town_barber", "always_on", 1 ); + add_adjacent_zone( "zone_town_barber", "zone_tow", "OnTowDoorBarber", 1 ); + add_adjacent_zone( "zone_town_barber", "zone_town_west", "OnTowDoorBarber" ); + add_adjacent_zone( "zone_far_ext", "zone_brn", "OnFarm_enter" ); + add_adjacent_zone( "zone_far_ext", "zone_farm_house", "open_farmhouse" ); + add_adjacent_zone( "zone_prr", "zone_pow", "OnPowDoorRR", 1 ); + add_adjacent_zone( "zone_pcr", "zone_prr", "OnPowDoorRR" ); + add_adjacent_zone( "zone_pcr", "zone_pow_warehouse", "OnPowDoorWH" ); + add_adjacent_zone( "zone_pow", "zone_pow_warehouse", "always_on" ); + add_adjacent_zone( "zone_tbu", "zone_tow", "vault_opened", 1 ); + add_adjacent_zone( "zone_trans_8","zone_pow", "always_on", 1 ); + add_adjacent_zone( "zone_trans_8", "zone_pow_warehouse", "always_on", 1 ); } \ No newline at end of file