1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-28 08:00:14 -05:00

Add Encounter Pro

This commit is contained in:
Jbleezy
2022-08-11 18:05:00 -07:00
parent ef1c48db1c
commit 799bf28803
7 changed files with 219 additions and 12 deletions

View File

@ -2,6 +2,62 @@
#include common_scripts\utility;
#include maps\mp\zombies\_zm_utility;
treasure_chest_init( start_chest_name )
{
flag_init( "moving_chest_enabled" );
flag_init( "moving_chest_now" );
flag_init( "chest_has_been_used" );
level.chest_moves = 0;
level.chest_level = 0;
if ( level.chests.size == 0 )
{
return;
}
i = 0;
while ( i < level.chests.size )
{
level.chests[ i ].box_hacks = [];
level.chests[ i ].orig_origin = level.chests[ i ].origin;
level.chests[ i ] maps/mp/zombies/_zm_magicbox::get_chest_pieces();
if ( isDefined( level.chests[ i ].zombie_cost ) )
{
level.chests[ i ].old_cost = level.chests[ i ].zombie_cost;
i++;
continue;
}
else
{
level.chests[ i ].old_cost = 950;
}
i++;
}
if ( (getDvar("g_gametype") == "zgrief" && getDvarIntDefault("ui_gametype_pro", 0)) || !level.enable_magic )
{
_a102 = level.chests;
_k102 = getFirstArrayKey( _a102 );
while ( isDefined( _k102 ) )
{
chest = _a102[ _k102 ];
chest maps/mp/zombies/_zm_magicbox::hide_chest();
_k102 = getNextArrayKey( _a102, _k102 );
}
return;
}
level.chest_accessed = 0;
if ( level.chests.size > 1 )
{
flag_set( "moving_chest_enabled" );
level.chests = array_randomize( level.chests );
}
else
{
level.chest_index = 0;
level.chests[ 0 ].no_fly_away = 1;
}
maps/mp/zombies/_zm_magicbox::init_starting_chest_location( start_chest_name );
array_thread( level.chests, maps/mp/zombies/_zm_magicbox::treasure_chest_think );
}
treasure_chest_move( player_vox )
{
level waittill( "weapon_fly_away_start" );

View File

@ -317,6 +317,67 @@ initialize_custom_perk_arrays()
struct.scr_zm_ui_gametype = "zclassic";
struct.scr_zm_map_start_location = "processing";
move_perk_machine("zm_buried", "street", "specialty_fastreload", struct);
if(getDvar("g_gametype") == "zgrief" && getDvarIntDefault("ui_gametype_pro", 0))
{
add_missing_perk_machines();
remove_perk_machines();
}
}
add_missing_perk_machines()
{
structs = getStructArray("zm_perk_machine", "targetname");
foreach(struct in structs)
{
if((level.script == "zm_transit" && level.scr_zm_map_start_location == "transit"))
{
if(isDefined(struct.script_noteworthy) && struct.script_noteworthy == "specialty_quickrevive")
{
if(isDefined(struct.script_string) && isSubStr(struct.script_string, "zclassic_perks_transit"))
{
struct.script_noteworthy = "specialty_armorvest";
struct.script_string += " zgrief_perks_transit";
}
}
if(isDefined(struct.script_noteworthy) && struct.script_noteworthy == "specialty_fastreload")
{
if(isDefined(struct.script_string) && isSubStr(struct.script_string, "zclassic_perks_transit"))
{
struct.script_string += " zgrief_perks_transit";
struct.origin = (-6304, 5363, -57);
struct.angles += (0, 180, 0);
}
}
}
else if((level.script == "zm_prison" && level.scr_zm_map_start_location == "cellblock"))
{
if(isDefined(struct.script_noteworthy) && struct.script_noteworthy == "specialty_rof")
{
if(isDefined(struct.script_string) && isSubStr(struct.script_string, "zgrief_perks_cellblock"))
{
struct.script_noteworthy = "specialty_armorvest";
struct.origin = (1411, 9663, 1335);
struct.angles += (0, 180, 0);
}
}
}
}
}
remove_perk_machines()
{
exceptions = array("specialty_armorvest", "specialty_fastreload");
structs = getStructArray("zm_perk_machine", "targetname");
foreach(struct in structs)
{
if(isDefined(struct.script_noteworthy) && !isInArray(exceptions, struct.script_noteworthy))
{
struct.script_string = "";
}
}
}
move_perk_machine(map, location, perk, move_struct)