diff --git a/scripts/zm/replaced/zm_prison_sq_bg.gsc b/scripts/zm/replaced/zm_prison_sq_bg.gsc new file mode 100644 index 00000000..d896dea4 --- /dev/null +++ b/scripts/zm/replaced/zm_prison_sq_bg.gsc @@ -0,0 +1,59 @@ +#include common_scripts\utility; +#include maps\mp\_utility; +#include maps\mp\zombies\_zm_utility; +#include maps\mp\zombies\_zm_net; +#include maps\mp\zombies\_zm_audio; +#include maps\mp\zombies\_zm_afterlife; +#include maps\mp\zombies\_zm_weap_tomahawk; +#include maps\mp\zm_prison_sq_bg; + +give_sq_bg_reward() +{ + s_reward_origin = getstruct( "sq_bg_reward", "targetname" ); + t_near = spawn( "trigger_radius", s_reward_origin.origin, 0, 196, 64 ); + + while ( true ) + { + t_near waittill( "trigger", ent ); + + if ( isplayer( ent ) ) + { + t_near thread sq_bg_spawn_rumble(); + break; + } + + wait 0.1; + } + + str_reward_weapon = "blundergat_zm"; + str_loc = &"ZM_PRISON_SQ_BG"; + m_reward_model = spawn_weapon_model( str_reward_weapon, undefined, s_reward_origin.origin, s_reward_origin.angles + (0, 0, 90) ); + m_reward_model moveto( m_reward_model.origin + vectorscale( ( 0, 0, 1 ), 14.0 ), 5 ); + level setclientfield( "sq_bg_reward_portal", 1 ); + self sethintstring( str_loc ); + + while ( true ) + { + self waittill( "trigger", player ); + + current_weapon = player getcurrentweapon(); + + if ( is_player_valid( player ) && !( player.is_drinking > 0 ) && !is_placeable_mine( current_weapon ) && !is_equipment( current_weapon ) && level.revive_tool != current_weapon && "none" != current_weapon && !player hacker_active() ) + { + if ( player hasweapon( str_reward_weapon ) ) + { + continue; + } + else + { + self delete(); + level setclientfield( "sq_bg_reward_portal", 0 ); + wait_network_frame(); + m_reward_model delete(); + player take_old_weapon_and_give_reward( current_weapon, str_reward_weapon ); + } + } + } + + t_near delete(); +} \ No newline at end of file diff --git a/scripts/zm/zm_prison/zm_prison_reimagined.gsc b/scripts/zm/zm_prison/zm_prison_reimagined.gsc index 1fea5d0d..c1d46695 100644 --- a/scripts/zm/zm_prison/zm_prison_reimagined.gsc +++ b/scripts/zm/zm_prison/zm_prison_reimagined.gsc @@ -13,6 +13,7 @@ #include scripts\zm\replaced\zm_alcatraz_traps; #include scripts\zm\replaced\zm_alcatraz_travel; #include scripts\zm\replaced\zm_alcatraz_weap_quest; +#include scripts\zm\replaced\zm_prison_sq_bg; #include scripts\zm\replaced\zm_prison_sq_final; #include scripts\zm\replaced\_zm_afterlife; #include scripts\zm\replaced\_zm_ai_brutus; @@ -39,7 +40,8 @@ main() replaceFunc(maps\mp\zm_alcatraz_traps::tower_trap_trigger_think, scripts\zm\replaced\zm_alcatraz_traps::tower_trap_trigger_think); replaceFunc(maps\mp\zm_alcatraz_travel::move_gondola, scripts\zm\replaced\zm_alcatraz_travel::move_gondola); replaceFunc(maps\mp\zm_alcatraz_weap_quest::grief_soul_catcher_state_manager, scripts\zm\replaced\zm_alcatraz_weap_quest::grief_soul_catcher_state_manager); - replaceFunc(maps\mp\zm_prison_sq_final::stage_one, scripts\zm\replaced\zm_prison_sq_final::stage_one); + replaceFunc(maps\mp\zm_prison_sq_bg::give_sq_bg_reward, scripts\zm\replaced\zm_prison_sq_bg::give_sq_bg_reward); + replaceFunc(maps\mp\zm_prison_sq_final::stage_one, scripts\zm\replaced\zm_prison_sq_final::stage_one); replaceFunc(maps\mp\zm_prison_sq_final::final_flight_trigger, scripts\zm\replaced\zm_prison_sq_final::final_flight_trigger); replaceFunc(maps\mp\zombies\_zm_afterlife::afterlife_add, scripts\zm\replaced\_zm_afterlife::afterlife_add); replaceFunc(maps\mp\zombies\_zm_afterlife::afterlife_laststand, scripts\zm\replaced\_zm_afterlife::afterlife_laststand);