1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-07 21:59:49 -05:00

Grief: remove extra spawn points on all maps

Spawn point override code for all maps is done in same script
Remove need for zm_transit_grief_farm.gsc
This commit is contained in:
Jbleezy 2022-01-01 23:56:35 -08:00
parent e3329445cd
commit 64c5c9c9cf
4 changed files with 141 additions and 235 deletions

View File

@ -105,7 +105,6 @@ main()
array_thread( level.zombie_spawners, ::add_spawn_function, ::remove_zombie_hats_for_grief );
maps/mp/zombies/_zm_ai_brutus::precache();
maps/mp/zombies/_zm_ai_brutus::init();
override_spawn_init();
level.enemy_location_override_func = ::enemy_location_override;
level._effect[ "butterflies" ] = loadfx( "maps/zombie_alcatraz/fx_alcatraz_skull_elec" );
a_t_door_triggers = getentarray( "zombie_door", "targetname" );
@ -419,52 +418,4 @@ turn_afterlife_interact_on()
{
self delete();
}
}
override_spawn_init()
{
match_string = "";
location = level.scr_zm_map_start_location;
if ( ( location == "default" || location == "" ) && isDefined( level.default_start_location ) )
{
location = level.default_start_location;
}
match_string = level.scr_zm_ui_gametype + "_" + location;
spawnpoints = [];
structs = getstructarray("initial_spawn", "script_noteworthy");
if ( isdefined( structs ) )
{
for ( i = 0; i < structs.size; i++ )
{
if ( isdefined( structs[ i ].script_string ) )
{
tokens = strtok( structs[ i ].script_string, " " );
foreach ( token in tokens )
{
if ( token == match_string )
{
spawnpoints[ spawnpoints.size ] = structs[ i ];
}
}
}
}
}
foreach(spawnpoint in spawnpoints)
{
if(spawnpoint.origin == (704, 9672, 1470) || spawnpoint.origin == (1008, 9684, 1470))
{
arrayremovevalue(structs, spawnpoint);
}
if(spawnpoint.origin == (704, 9712, 1471) || spawnpoint.origin == (1008, 9720, 1470))
{
spawnpoint.origin += (0, -16, 0);
}
else if(spawnpoint.origin == (704, 9632, 1470) || spawnpoint.origin == (1008, 9640, 1470))
{
spawnpoint.origin += (0, 16, 0);
}
}
}

View File

@ -72,7 +72,6 @@ main()
move_quickrevive_machine();
move_speedcola_machine();
move_staminup_machine();
override_spawn_init();
powerswitchstate( 1 );
level.enemy_location_override_func = ::enemy_location_override;
@ -592,52 +591,4 @@ move_staminup_machine()
powered_on = maps/mp/zombies/_zm_perks::get_perk_machine_start_state( use_trigger.script_noteworthy );
maps/mp/zombies/_zm_power::add_powered_item( maps/mp/zombies/_zm_power::perk_power_on, scripts/zm/main/_zm_reimagined::perk_power_off, maps/mp/zombies/_zm_power::perk_range, maps/mp/zombies/_zm_power::cost_low_if_local, 0, powered_on, use_trigger );
}
override_spawn_init()
{
// remove existing initial spawns
structs = getstructarray("initial_spawn", "script_noteworthy");
array_delete(structs, true);
level.struct_class_names["script_noteworthy"]["initial_spawn"] = [];
// set new initial spawns to be same as respawns already on map
ind = 0;
spawn_points = maps/mp/gametypes_zm/_zm_gametype::get_player_spawns_for_gametype();
for(i = 0; i < spawn_points.size; i++)
{
if(spawn_points[i].script_noteworthy == "zone_stables")
{
ind = i;
break;
}
}
init_spawn_array = getstructarray(spawn_points[ind].target, "targetname");
foreach(init_spawn in init_spawn_array)
{
struct = spawnStruct();
struct.origin = init_spawn.origin;
struct.angles = init_spawn.angles;
struct.radius = init_spawn.radius;
if(struct.origin == (-722.02, -151.75, 124.14))
{
struct.script_int = 1;
}
else if(struct.origin == (-891.27, -209.95, 137.94))
{
struct.script_int = 2;
}
else
{
struct.script_int = init_spawn.script_int;
}
struct.script_noteworthy = "initial_spawn";
struct.script_string = "zgrief_street";
size = level.struct_class_names["script_noteworthy"][struct.script_noteworthy].size;
level.struct_class_names["script_noteworthy"][struct.script_noteworthy][size] = struct;
}
}

View File

@ -1,137 +0,0 @@
#include maps/mp/gametypes_zm/zmeat;
#include maps/mp/zombies/_zm_game_module;
#include maps/mp/zombies/_zm_zonemgr;
#include maps/mp/gametypes_zm/_zm_gametype;
#include maps/mp/zombies/_zm_magicbox;
#include maps/mp/zombies/_zm_utility;
#include common_scripts/utility;
#include maps/mp/_utility;
precache()
{
}
farm_treasure_chest_init()
{
chest1 = getstruct( "farm_chest", "script_noteworthy" );
level.chests = [];
level.chests[ level.chests.size ] = chest1;
maps/mp/zombies/_zm_magicbox::treasure_chest_init( "farm_chest" );
}
main()
{
maps/mp/gametypes_zm/_zm_gametype::setup_standard_objects( "farm" );
init_standard_farm();
farm_treasure_chest_init();
override_spawn_init();
level.enemy_location_override_func = ::enemy_location_override;
flag_wait( "initial_blackscreen_passed" );
level thread maps/mp/zombies/_zm_zonemgr::enable_zone( "zone_far_ext" );
level thread maps/mp/zombies/_zm_zonemgr::enable_zone( "zone_brn" );
maps/mp/zombies/_zm_game_module::turn_power_on_and_open_doors();
flag_wait( "start_zombie_round_logic" );
wait 1;
level notify( "revive_on" );
wait_network_frame();
level notify( "doubletap_on" );
wait_network_frame();
level notify( "juggernog_on" );
wait_network_frame();
level notify( "sleight_on" );
wait_network_frame();
}
init_standard_farm()
{
maps/mp/zombies/_zm_game_module::set_current_game_module( level.game_module_standard_index );
ents = getentarray();
foreach ( ent in ents )
{
if ( isDefined( ent.script_flag ) && ent.script_flag == "OnFarm_enter" )
{
ent delete();
}
else
{
if ( isDefined( ent.script_parameters ) )
{
tokens = strtok( ent.script_parameters, " " );
remove = 0;
for ( i = 0; i < tokens.size; i++ )
{
if ( tokens[ i ] == "standard_remove" )
{
remove = 1;
}
}
if ( remove )
{
ent delete();
}
}
}
}
}
enemy_location_override( zombie, enemy )
{
location = enemy.origin;
if ( is_true( self.reroute ) )
{
if ( isDefined( self.reroute_origin ) )
{
location = self.reroute_origin;
}
}
return location;
}
override_spawn_init()
{
match_string = "";
location = level.scr_zm_map_start_location;
if ( ( location == "default" || location == "" ) && isDefined( level.default_start_location ) )
{
location = level.default_start_location;
}
match_string = level.scr_zm_ui_gametype + "_" + location;
spawnpoints = [];
structs = getstructarray("initial_spawn", "script_noteworthy");
if ( isdefined( structs ) )
{
for ( i = 0; i < structs.size; i++ )
{
if ( isdefined( structs[ i ].script_string ) )
{
tokens = strtok( structs[ i ].script_string, " " );
foreach ( token in tokens )
{
if ( token == match_string )
{
spawnpoints[ spawnpoints.size ] = structs[ i ];
}
}
}
}
}
foreach(spawnpoint in spawnpoints)
{
if(spawnpoint.origin == (7211, -5800, -17.93) || spawnpoint.origin == (7152, -5663, -18.53))
{
arrayremovevalue(structs, spawnpoint);
}
if(spawnpoint.origin == (8379, -5693, 73.71))
{
spawnpoint.origin = (7785, -5922, 53);
spawnpoint.angles = (0, 80, 0);
spawnpoint.script_int = 2;
}
}
}

View File

@ -59,6 +59,8 @@ init()
level.zombie_weapons["willy_pete_zm"].is_in_box = 1;
}
player_spawn_override();
level thread grief_score_hud();
level thread set_grief_vars();
level thread round_start_wait(5, true);
@ -219,6 +221,145 @@ set_grief_vars()
level.stun_fx_amount = 3;
}
player_spawn_override()
{
match_string = "";
location = level.scr_zm_map_start_location;
if ( ( location == "default" || location == "" ) && isDefined( level.default_start_location ) )
{
location = level.default_start_location;
}
match_string = level.scr_zm_ui_gametype + "_" + location;
spawnpoints = [];
structs = getstructarray( "initial_spawn", "script_noteworthy" );
if ( isdefined( structs ) )
{
for ( i = 0; i < structs.size; i++ )
{
if ( isdefined( structs[ i ].script_string ) )
{
tokens = strtok( structs[ i ].script_string, " " );
foreach ( token in tokens )
{
if ( token == match_string )
{
spawnpoints[ spawnpoints.size ] = structs[ i ];
}
}
}
}
}
if(level.script == "zm_transit" && level.scr_zm_map_start_location == "transit")
{
foreach(spawnpoint in spawnpoints)
{
if(spawnpoint.origin == (-6538, 5200, -28) || spawnpoint.origin == (-6713, 5079, -28) || spawnpoint.origin == (-6929, 5444, -28.92) || spawnpoint.origin == (-7144, 5264, -28))
{
arrayremovevalue(structs, spawnpoint);
}
}
}
else if(level.script == "zm_transit" && level.scr_zm_map_start_location == "farm")
{
foreach(spawnpoint in spawnpoints)
{
if(spawnpoint.origin == (7211, -5800, -17.93) || spawnpoint.origin == (7152, -5663, -18.53))
{
arrayremovevalue(structs, spawnpoint);
}
else if(spawnpoint.origin == (8379, -5693, 73.71))
{
spawnpoint.origin = (7785, -5922, 53);
spawnpoint.angles = (0, 80, 0);
spawnpoint.script_int = 2;
}
}
}
else if(level.script == "zm_transit" && level.scr_zm_map_start_location == "town")
{
foreach(spawnpoint in spawnpoints)
{
if(spawnpoint.origin == (1585.5, -754.8, -32.04) || spawnpoint.origin == (1238.5, -303, -31.76))
{
arrayremovevalue(structs, spawnpoint);
}
else if(spawnpoint.origin == (1544, -188, -34))
{
spawnpoint.angles = (0, 245, 0);
}
else if(spawnpoint.origin == (1430.5, -159, -34))
{
spawnpoint.angles = (0, 270, 0);
}
}
}
else if(level.script == "zm_prison" && level.scr_zm_map_start_location == "cellblock")
{
foreach(spawnpoint in spawnpoints)
{
if(spawnpoint.origin == (704, 9672, 1470) || spawnpoint.origin == (1008, 9684, 1470))
{
arrayremovevalue(structs, spawnpoint);
}
else if(spawnpoint.origin == (704, 9712, 1471) || spawnpoint.origin == (1008, 9720, 1470))
{
spawnpoint.origin += (0, -16, 0);
}
else if(spawnpoint.origin == (704, 9632, 1470) || spawnpoint.origin == (1008, 9640, 1470))
{
spawnpoint.origin += (0, 16, 0);
}
}
}
else if(level.script == "zm_buried" && level.scr_zm_map_start_location == "street")
{
// remove existing initial spawns
array_delete(structs, true);
level.struct_class_names["script_noteworthy"]["initial_spawn"] = [];
// set new initial spawns to be same as respawns already on map
ind = 0;
respawnpoints = maps/mp/gametypes_zm/_zm_gametype::get_player_spawns_for_gametype();
for(i = 0; i < respawnpoints.size; i++)
{
if(respawnpoints[i].script_noteworthy == "zone_stables")
{
ind = i;
break;
}
}
respawn_array = getstructarray(respawnpoints[ind].target, "targetname");
foreach(respawn in respawn_array)
{
struct = spawnStruct();
struct.origin = respawn.origin;
struct.angles = respawn.angles;
struct.radius = respawn.radius;
if(struct.origin == (-722.02, -151.75, 124.14))
{
struct.script_int = 1;
}
else if(struct.origin == (-891.27, -209.95, 137.94))
{
struct.script_int = 2;
}
else
{
struct.script_int = respawn.script_int;
}
struct.script_noteworthy = "initial_spawn";
struct.script_string = "zgrief_street";
size = level.struct_class_names["script_noteworthy"][struct.script_noteworthy].size;
level.struct_class_names["script_noteworthy"][struct.script_noteworthy][size] = struct;
}
}
}
grief_onplayerconnect()
{
self set_team();