diff --git a/scripts/zm/zgrief/zgrief_reimagined.gsc b/scripts/zm/zgrief/zgrief_reimagined.gsc index 418c6db7..f19b2f12 100644 --- a/scripts/zm/zgrief/zgrief_reimagined.gsc +++ b/scripts/zm/zgrief/zgrief_reimagined.gsc @@ -62,7 +62,6 @@ init() powerup_hud_overlay(); grief_gamemode_hud(); grief_score_hud(); - player_spawn_override(); if(level.scr_zm_ui_gametype_obj == "zcontainment") { @@ -509,170 +508,6 @@ powerup_fade_over_time() } } -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" && getDvar("ui_zm_mapstartlocation_fake") != "docks") - { - 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); - } - - // prevents spawning up top in 3rd Floor zone due to not being enough height clearance - spawnpoint.origin += (0, 0, -16); - } - } - else if(level.script == "zm_buried" && level.scr_zm_map_start_location == "street" && getDvar("ui_zm_mapstartlocation_fake") != "maze") - { - // 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; - struct.script_int = respawn.script_int; - struct.script_noteworthy = "initial_spawn"; - struct.script_string = "zgrief_street"; - - if(struct.origin == (-875.5, -33.85, 139.25)) - { - struct.angles = (0, 10, 0); - } - else if(struct.origin == (-910.13, -90.16, 139.59)) - { - struct.angles = (0, 20, 0); - } - else if(struct.origin == (-921.9, -134.67, 140.62)) - { - struct.angles = (0, 30, 0); - } - else if(struct.origin == (-891.27, -209.95, 137.94)) - { - struct.angles = (0, 55, 0); - struct.script_int = 2; - } - else if(struct.origin == (-836.66, -257.92, 133.16)) - { - struct.angles = (0, 65, 0); - } - else if(struct.origin == (-763, -259.07, 127.72)) - { - struct.angles = (0, 90, 0); - } - else if(struct.origin == (-737.98, -212.92, 125.4)) - { - struct.angles = (0, 85, 0); - } - else if(struct.origin == (-722.02, -151.75, 124.14)) - { - struct.angles = (0, 80, 0); - struct.script_int = 1; - } - - 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 thread on_player_spawned(); diff --git a/scripts/zm/zm_buried/zm_buried_reimagined.gsc b/scripts/zm/zm_buried/zm_buried_reimagined.gsc index ba41d873..3d563694 100644 --- a/scripts/zm/zm_buried/zm_buried_reimagined.gsc +++ b/scripts/zm/zm_buried/zm_buried_reimagined.gsc @@ -91,6 +91,7 @@ init() level.check_for_valid_spawn_near_team_callback = undefined; } + player_initial_spawn_override(); power_switch_model(); sloth_barricades_buyable(); add_jug_collision(); @@ -129,6 +130,79 @@ buried_special_weapon_magicbox_check(weapon) return 1; } +player_initial_spawn_override() +{ + initial_spawns = getstructarray( "initial_spawn", "script_noteworthy" ); + + if (level.scr_zm_map_start_location == "street" && getDvar("ui_zm_mapstartlocation_fake") != "maze") + { + // remove existing initial spawns + level.struct_class_names["script_noteworthy"]["initial_spawn"] = []; + + // set new initial spawns to be same as respawns already on map + ind = 0; + respawn_points = maps\mp\gametypes_zm\_zm_gametype::get_player_spawns_for_gametype(); + for (i = 0; i < respawn_points.size; i++) + { + if (respawn_points[i].script_noteworthy == "zone_stables") + { + ind = i; + break; + } + } + + respawn_array = getstructarray(respawn_points[ind].target, "targetname"); + foreach (respawn in respawn_array) + { + struct = spawnStruct(); + struct.origin = respawn.origin; + struct.angles = respawn.angles; + struct.radius = respawn.radius; + struct.script_int = respawn.script_int; + struct.script_noteworthy = "initial_spawn"; + struct.script_string = "zgrief_street"; + + if (struct.origin == (-875.5, -33.85, 139.25)) + { + struct.angles = (0, 10, 0); + } + else if (struct.origin == (-910.13, -90.16, 139.59)) + { + struct.angles = (0, 20, 0); + } + else if (struct.origin == (-921.9, -134.67, 140.62)) + { + struct.angles = (0, 30, 0); + } + else if (struct.origin == (-891.27, -209.95, 137.94)) + { + struct.angles = (0, 55, 0); + struct.script_int = 2; + } + else if (struct.origin == (-836.66, -257.92, 133.16)) + { + struct.angles = (0, 65, 0); + } + else if (struct.origin == (-763, -259.07, 127.72)) + { + struct.angles = (0, 90, 0); + } + else if (struct.origin == (-737.98, -212.92, 125.4)) + { + struct.angles = (0, 85, 0); + } + else if (struct.origin == (-722.02, -151.75, 124.14)) + { + struct.angles = (0, 80, 0); + struct.script_int = 1; + } + + size = level.struct_class_names["script_noteworthy"][struct.script_noteworthy].size; + level.struct_class_names["script_noteworthy"][struct.script_noteworthy][size] = struct; + } + } +} + power_switch_model() { model = spawn( "script_model", (626.36, -401.555, 133.149), 1); diff --git a/scripts/zm/zm_prison/zm_prison_reimagined.gsc b/scripts/zm/zm_prison/zm_prison_reimagined.gsc index d0dccbb5..e32bcb3d 100644 --- a/scripts/zm/zm_prison/zm_prison_reimagined.gsc +++ b/scripts/zm/zm_prison/zm_prison_reimagined.gsc @@ -96,7 +96,8 @@ init() maps\mp\zombies\_zm::spawn_life_brush( (94, 6063, 240), 256, 256 ); - player_spawn_location_changes(); + player_initial_spawn_override(); + player_respawn_override(); level thread updatecraftables(); level thread grief_brutus_spawn_after_time(); @@ -193,23 +194,63 @@ door_buy_afterlife_check(door) return true; } -player_spawn_location_changes() +player_initial_spawn_override() { - spawn_points = maps\mp\gametypes_zm\_zm_gametype::get_player_spawns_for_gametype(); - foreach(spawn_point in spawn_points) + initial_spawns = getstructarray( "initial_spawn", "script_noteworthy" ); + remove_initial_spawns = []; + + if (level.scr_zm_map_start_location == "cellblock" && getDvar("ui_zm_mapstartlocation_fake") != "docks") { - if(spawn_point.script_noteworthy == "zone_cafeteria") + foreach (initial_spawn in initial_spawns) { - spawn_array = getstructarray( spawn_point.target, "targetname" ); - foreach(spawn in spawn_array) + if (initial_spawn.origin == (704, 9672, 1470) || initial_spawn.origin == (1008, 9684, 1470)) { - if(spawn.origin == (2536, 9704, 1360)) + remove_initial_spawns[remove_initial_spawns.size] = initial_spawn; + } + else if (initial_spawn.origin == (704, 9712, 1471) || initial_spawn.origin == (1008, 9720, 1470)) + { + initial_spawn.origin += (0, -16, 0); + } + else if (initial_spawn.origin == (704, 9632, 1470) || initial_spawn.origin == (1008, 9640, 1470)) + { + initial_spawn.origin += (0, 16, 0); + } + + // prevents spawning up top in 3rd Floor zone due to not being enough height clearance + initial_spawn.origin += (0, 0, -16); + } + } + + foreach (initial_spawn in remove_initial_spawns) + { + arrayremovevalue(initial_spawns, initial_spawn); + } +} + +player_respawn_override() +{ + respawn_points = getstructarray( "player_respawn_point", "targetname" ); + + foreach(respawn_point in respawn_points) + { + if(respawn_point.script_noteworthy == "zone_cafeteria") + { + respawn_array = getstructarray( respawn_point.target, "targetname" ); + remove_respawn_array = []; + + foreach(respawn in respawn_array) + { + if(respawn.origin == (2536, 9704, 1360)) { - // spawn is in acid trap - arrayremovevalue(spawn_array, spawn); - return; + // respawn is in acid trap + remove_respawn_array[remove_respawn_array.size] = respawn; } } + + foreach(respawn in remove_respawn_array) + { + arrayremovevalue(respawn_array, respawn); + } } } } diff --git a/scripts/zm/zm_transit/zm_transit_reimagined.gsc b/scripts/zm/zm_transit/zm_transit_reimagined.gsc index d5396719..e08c0f5d 100644 --- a/scripts/zm/zm_transit/zm_transit_reimagined.gsc +++ b/scripts/zm/zm_transit/zm_transit_reimagined.gsc @@ -83,7 +83,8 @@ init() level.grenade_safe_to_bounce = ::grenade_safe_to_bounce; level.object_touching_lava = maps\mp\zm_transit_lava::object_touching_lava; - player_spawn_location_changes(); + player_initial_spawn_override(); + player_respawn_override(); zombie_spawn_location_changes(); buildable_table_models(); cornfield_add_collision(); @@ -240,44 +241,104 @@ grenade_safe_to_bounce( player, weapname ) return 1; } -player_spawn_location_changes() +player_initial_spawn_override() { - spawn_points = maps\mp\gametypes_zm\_zm_gametype::get_player_spawns_for_gametype(); - foreach (spawn_point in spawn_points) + initial_spawns = getstructarray( "initial_spawn", "script_noteworthy" ); + remove_initial_spawns = []; + + if (level.scr_zm_map_start_location == "transit") { - if (spawn_point.script_noteworthy == "zone_station_ext") + foreach (initial_spawn in initial_spawns) { - spawn_array = getstructarray(spawn_point.target, "targetname"); + if (initial_spawn.origin == (-6538, 5200, -28) || initial_spawn.origin == (-6713, 5079, -28) || initial_spawn.origin == (-6929, 5444, -28.92) || initial_spawn.origin == (-7144, 5264, -28)) + { + remove_initial_spawns[remove_initial_spawns.size] = initial_spawn; + } + } + } + else if (level.scr_zm_map_start_location == "farm") + { + foreach (initial_spawn in initial_spawns) + { + if (initial_spawn.origin == (7211, -5800, -17.93) || initial_spawn.origin == (7152, -5663, -18.53)) + { + remove_initial_spawns[remove_initial_spawns.size] = initial_spawn; + } + else if (initial_spawn.origin == (8379, -5693, 73.71)) + { + initial_spawn.origin = (7785, -5922, 53); + initial_spawn.angles = (0, 80, 0); + initial_spawn.script_int = 2; + } + } + } + else if (level.scr_zm_map_start_location == "town") + { + foreach (initial_spawn in initial_spawns) + { + if (initial_spawn.origin == (1585.5, -754.8, -32.04) || initial_spawn.origin == (1238.5, -303, -31.76)) + { + remove_initial_spawns[remove_initial_spawns.size] = initial_spawn; + } + else if (initial_spawn.origin == (1544, -188, -34)) + { + initial_spawn.angles = (0, 245, 0); + } + else if (initial_spawn.origin == (1430.5, -159, -34)) + { + initial_spawn.angles = (0, 270, 0); + } + } + } - spawn_array[0].origin = (-6173, 4753, -34); - spawn_array[0].angles = (0, -90, 0); + foreach (initial_spawn in remove_initial_spawns) + { + arrayremovevalue(initial_spawns, initial_spawn); + } +} - spawn_array[1].origin = (-6449, 4753, -35); - spawn_array[1].angles = (0, -90, 0); +player_respawn_override() +{ + respawn_points = getstructarray( "player_respawn_point", "targetname" ); - spawn_array[2].origin = (-7050, 4753, -35); - spawn_array[2].angles = (0, -90, 0); + if (level.scr_zm_map_start_location == "transit" && level.scr_zm_ui_gametype != "zclassic") + { + foreach (respawn_point in respawn_points) + { + if (respawn_point.script_noteworthy == "zone_station_ext") + { + respawn_array = getstructarray(respawn_point.target, "targetname"); - spawn_array[3].origin = (-7263, 4753, -35); - spawn_array[3].angles = (0, -90, 0); + respawn_array[0].origin = (-6173, 4753, -34); + respawn_array[0].angles = (0, -90, 0); - spawn_array[4].origin = (-7423, 4753, -35); - spawn_array[4].angles = (0, -90, 0); + respawn_array[1].origin = (-6449, 4753, -35); + respawn_array[1].angles = (0, -90, 0); - spawn_array[5].origin = (-6160, 4300, -29); - spawn_array[5].angles = (0, 90, 0); + respawn_array[2].origin = (-7050, 4753, -35); + respawn_array[2].angles = (0, -90, 0); - spawn_array[6].origin = (-6680, 4300, -35); - spawn_array[6].angles = (0, 90, 0); + respawn_array[3].origin = (-7263, 4753, -35); + respawn_array[3].angles = (0, -90, 0); - spawn_array[7].origin = (-7050, 4404, -35); - spawn_array[7].angles = (0, 90, 0); + respawn_array[4].origin = (-7423, 4753, -35); + respawn_array[4].angles = (0, -90, 0); - spawn_array[8].origin = (-7263, 4404, -35); - spawn_array[8].angles = (0, 90, 0); + respawn_array[5].origin = (-6160, 4300, -29); + respawn_array[5].angles = (0, 90, 0); - spawn_array[9].origin = (-7423, 4404, -35); - spawn_array[9].angles = (0, 90, 0); + respawn_array[6].origin = (-6680, 4300, -35); + respawn_array[6].angles = (0, 90, 0); + + respawn_array[7].origin = (-7050, 4404, -35); + respawn_array[7].angles = (0, 90, 0); + + respawn_array[8].origin = (-7263, 4404, -35); + respawn_array[8].angles = (0, 90, 0); + + respawn_array[9].origin = (-7423, 4404, -35); + respawn_array[9].angles = (0, 90, 0); + } } } }