1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-10 23:27:57 -05:00

Reorganize custom location utility script

This commit is contained in:
Jbleezy
2022-01-12 06:46:11 -08:00
parent ef9f539e69
commit b6468128d1
2 changed files with 31 additions and 30 deletions

View File

@ -11,10 +11,10 @@ struct_init()
{ {
if ( !is_true( level.ctsm_disable_custom_perk_locations ) ) if ( !is_true( level.ctsm_disable_custom_perk_locations ) )
{ {
scripts/zm/replaced/utility::register_perk_struct( "specialty_armorvest", "zombie_vending_jugg", ( 0, 0, 0 ), ( -3563, -7196, -59 ) ); scripts/zm/replaced/utility::register_perk_struct( "specialty_armorvest", "zombie_vending_jugg", ( -3563, -7196, -59 ), ( 0, 0, 0 ) );
scripts/zm/replaced/utility::register_perk_struct( "specialty_quickrevive", "zombie_vending_quickrevive", ( 0, 60, 0 ), ( -6207, -6544, -46 ) ); scripts/zm/replaced/utility::register_perk_struct( "specialty_quickrevive", "zombie_vending_quickrevive", ( -6207, -6544, -46 ), ( 0, 60, 0 ) );
scripts/zm/replaced/utility::register_perk_struct( "specialty_fastreload", "zombie_vending_sleight", ( 0, 270, 0 ), ( -5470, -7859.5, 0 ) ); scripts/zm/replaced/utility::register_perk_struct( "specialty_fastreload", "zombie_vending_sleight", ( -5470, -7859.5, 0 ), ( 0, 270, 0 ) );
scripts/zm/replaced/utility::register_perk_struct( "specialty_rof", "zombie_vending_doubletap2", ( 0, 270, 0 ), ( -4170, -7592, -63 ) ); scripts/zm/replaced/utility::register_perk_struct( "specialty_rof", "zombie_vending_doubletap2", ( -4170, -7592, -63 ), ( 0, 270, 0 ) );
} }
coordinates = array( ( -3991, -7317, -63 ), ( -4231, -7395, -60 ), ( -4127, -6757, -54 ), ( -4465, -7346, -58 ), coordinates = array( ( -3991, -7317, -63 ), ( -4231, -7395, -60 ), ( -4127, -6757, -54 ), ( -4465, -7346, -58 ),
( -5770, -6600, -55 ), ( -6135, -6671, -56 ), ( -6182, -7120, -60 ), ( -5882, -7174, -61 ) ); ( -5770, -6600, -55 ), ( -6135, -6671, -56 ), ( -6182, -7120, -60 ), ( -5882, -7174, -61 ) );
@ -57,9 +57,9 @@ treasure_chest_init()
init_wallbuys() init_wallbuys()
{ {
scripts/zm/replaced/utility::wallbuy( ( 0, 0, 0 ), ( -5085, -7807, -5 ), "rottweil72_zm_fx", "rottweil72_zm", "t6_wpn_shotty_olympia_world", "olympia", "weapon_upgrade" ); scripts/zm/replaced/utility::wallbuy( "rottweil72_zm", "olympia", "weapon_upgrade", ( -5085, -7807, -5 ), ( 0, 0, 0 ) );
scripts/zm/replaced/utility::wallbuy( (0, 90, 0 ), ( -4576, -7748, 18 ), "m14_zm_fx", "m14_zm", "t6_wpn_ar_m14_world", "m14", "weapon_upgrade" ); scripts/zm/replaced/utility::wallbuy( "m14_zm", "m14", "weapon_upgrade", ( -4576, -7748, 18 ), ( 0, 90, 0 ) );
scripts/zm/replaced/utility::wallbuy( ( 0, 1, 0 ), ( -5489, -7982.7, 62 ), "mp5k_zm_fx", "mp5k_zm", "t6_wpn_smg_mp5_world", "mp5", "weapon_upgrade" ); scripts/zm/replaced/utility::wallbuy( "mp5k_zm", "mp5", "weapon_upgrade", ( -5489, -7982.7, 62 ), ( 0, 1, 0 ) );
} }
init_barriers() init_barriers()

View File

@ -123,34 +123,34 @@ add_struct( s_struct )
} }
} }
register_perk_struct( perk_name, perk_model, perk_angles, perk_coordinates ) register_perk_struct( name, model, origin, angles )
{ {
perk_struct = spawnStruct(); perk_struct = spawnStruct();
perk_struct.script_noteworthy = perk_name; perk_struct.script_noteworthy = name;
perk_struct.model = perk_model; perk_struct.model = model;
perk_struct.angles = perk_angles; perk_struct.angles = angles;
perk_struct.origin = perk_coordinates; perk_struct.origin = origin;
perk_struct.targetname = "zm_perk_machine"; perk_struct.targetname = "zm_perk_machine";
// if ( perk_name == "specialty_weapupgrade" ) // if ( name == "specialty_weapupgrade" )
// { // {
// perk_struct.target = "weapupgrade_flag_targ"; // perk_struct.target = "weapupgrade_flag_targ";
// flag = spawnStruct(); // flag = spawnStruct();
// flag.targetname = "weapupgrade_flag_targ"; // flag.targetname = "weapupgrade_flag_targ";
// flag.model = "zombie_sign_please_wait"; // flag.model = "zombie_sign_please_wait";
// flag.angles = ( 0, perk_angles[ 1 ] - 180, perk_angles[ 2 ] - 180 ); // flag.angles = ( 0, angles[ 1 ] - 180, angles[ 2 ] - 180 );
// flag.origin = ( perk_coordinates[ 0 ] + 13.5, perk_coordinates[ 1 ] - 29, perk_coordinates[ 2 ] + 49.5 ); // flag.origin = ( origin[ 0 ] + 13.5, origin[ 1 ] - 29, origin[ 2 ] + 49.5 );
// add_struct( flag ); // add_struct( flag );
// } // }
add_struct( perk_struct ); add_struct( perk_struct );
} }
register_map_initial_spawnpoint( spawnpoint_coordinates, spawnpoint_angles ) register_map_initial_spawnpoint( origin, angles )
{ {
spawnpoint_struct = spawnStruct(); spawnpoint_struct = spawnStruct();
spawnpoint_struct.origin = spawnpoint_coordinates; spawnpoint_struct.origin = origin;
if ( isDefined( spawnpoint_angles ) ) if ( isDefined( angles ) )
{ {
spawnpoint_struct.angles = spawnpoint_angles; spawnpoint_struct.angles = angles;
} }
else else
{ {
@ -167,20 +167,20 @@ register_map_initial_spawnpoint( spawnpoint_coordinates, spawnpoint_angles )
level.struct_class_names[ "script_noteworthy" ][ "initial_spawn" ][ player_initial_spawnpoint_size ] = spawnpoint_struct; level.struct_class_names[ "script_noteworthy" ][ "initial_spawn" ][ player_initial_spawnpoint_size ] = spawnpoint_struct;
} }
wallbuy( weapon_angles, weapon_coordinates, chalk_fx, weapon_name, weapon_model, target, targetname ) wallbuy( weapon_name, target, targetname, origin, angles )
{ {
precachemodel( weapon_model ); precachemodel( getweaponmodel( weapon_name ) );
unitrigger_stub = spawnstruct(); unitrigger_stub = spawnstruct();
unitrigger_stub.origin = weapon_coordinates; unitrigger_stub.origin = origin;
unitrigger_stub.angles = weapon_angles; unitrigger_stub.angles = angles;
// move model foreward so it always shows in front of chalk // move model foreward so it always shows in front of chalk
wallmodel = spawn_weapon_model( weapon_name, undefined, weapon_coordinates + anglesToRight(weapon_angles) * -0.4, weapon_angles ); wallmodel = spawn_weapon_model( weapon_name, undefined, origin + anglesToRight(angles) * -0.4, angles );
wallmodel.targetname = target; wallmodel.targetname = target;
mins = undefined; mins = undefined;
maxs = undefined; maxs = undefined;
absmins = undefined; absmins = undefined;
absmaxs = undefined; absmaxs = undefined;
wallmodel setmodel( weapon_model ); wallmodel setmodel( getweaponmodel( weapon_name ) );
wallmodel useweaponhidetags( weapon_name ); wallmodel useweaponhidetags( weapon_name );
mins = wallmodel getmins(); mins = wallmodel getmins();
maxs = wallmodel getmaxs(); maxs = wallmodel getmaxs();
@ -238,7 +238,8 @@ wallbuy( weapon_angles, weapon_coordinates, chalk_fx, weapon_name, weapon_model,
maps/mp/zombies/_zm_unitrigger::register_static_unitrigger( unitrigger_stub, ::weapon_spawn_think ); maps/mp/zombies/_zm_unitrigger::register_static_unitrigger( unitrigger_stub, ::weapon_spawn_think );
} }
wallmodel hide(); wallmodel hide();
thread playchalkfx( chalk_fx, weapon_coordinates, weapon_angles ); chalk_fx = weapon_name + "_fx";
level thread playchalkfx( chalk_fx, origin, angles );
} }
playchalkfx( effect, origin, angles ) playchalkfx( effect, origin, angles )
@ -252,16 +253,16 @@ playchalkfx( effect, origin, angles )
} }
} }
barrier( barrier_coordinates, barrier_model, barrier_angles, not_solid ) barrier( model, origin, angles, not_solid )
{ {
if ( !isDefined( level.survival_barriers ) ) if ( !isDefined( level.survival_barriers ) )
{ {
level.survival_barriers = []; level.survival_barriers = [];
level.survival_barriers_index = 0; level.survival_barriers_index = 0;
} }
level.survival_barriers[ level.survival_barriers_index ] = spawn( "script_model", barrier_coordinates ); level.survival_barriers[ level.survival_barriers_index ] = spawn( "script_model", origin );
level.survival_barriers[ level.survival_barriers_index ] setModel( barrier_model ); level.survival_barriers[ level.survival_barriers_index ] setModel( model );
level.survival_barriers[ level.survival_barriers_index ] rotateTo( barrier_angles, 0.1 ); level.survival_barriers[ level.survival_barriers_index ] rotateTo( angles, 0.1 );
level.survival_barriers[ level.survival_barriers_index ] disconnectPaths(); level.survival_barriers[ level.survival_barriers_index ] disconnectPaths();
if ( is_true( not_solid ) ) if ( is_true( not_solid ) )
{ {