[Release] [Zombies] Black Ops 1 Shared mystery box

Topic created ยท 7 Posts ยท 584 Views
  • This script allow sharing weapon with teammates.

    Tested only in solo zombie game

    d793c67d-d24c-4f5a-a372-81bdb4c46e1f-kuva.png

    INSTALL: Copy the code to text editor and save it as you like but the file has to have .gsc extension. Copy the file to %localappdata%\Plutonium\storage\t5\scripts\sp and start your map.

    If you have issues starting Plutonium Black ops 1 while the file is in the folder remove the file and start the game. After game is running you can place the script back.

    (I could not start the game while the file was already in the folder. I guess it will be fixed later if more people has same issue)

    //Black ops 1 Shared mystery box
    
    #include maps\_utility; 
    #include common_scripts\utility;
    #include maps\_zombiemode_utility;
    #include maps\_zombiemode_audio;
    init()
    {
        if ( GetDvar( #"zombiemode" ) == "1" )
    	{
            level thread CheckForCurrentBox();
            level.shared_box = 0;
        }
    }
    
    CheckForCurrentBox()
    {
        wait 10;
        for(i = 0; i < level.chests.size; i++)
        {
            level.chests[ i ] thread reset_box();
    		if(level.chests[ i ].hidden)
        	{
    			level.chests[ i ] get_chest_pieces();
        	}
    	}
    }
    
    reset_box()
    {
    	self notify("kill_chest_think");
        wait .1;
    	if(!self.hidden)
        {
    		self.grab_weapon_hint = 0;
    	}
    	self thread custom_treasure_chest_think();
    }
    
    get_chest_pieces()
    {
    	self.chest_lid = GetEnt(self.target, "targetname");
    	self.chest_origin = GetEnt(self.chest_lid.target, "targetname");
    	self.chest_box = GetEnt(self.chest_origin.target, "targetname");
    	self.chest_rubble	= [];
    	rubble = GetEntArray( self.script_noteworthy + "_rubble", "script_noteworthy" );
    	for ( i=0; i<rubble.size; i++ )
    	{
    		if ( DistanceSquared( self.origin, rubble[i].origin ) < 10000 )
    		{
    			self.chest_rubble[ self.chest_rubble.size ]	= rubble[i];
    		}
    	}
    }
    
    custom_treasure_chest_think()
    {
    	self endon("kill_chest_think");
    	if( IsDefined(level.zombie_vars["zombie_powerup_fire_sale_on"]) && level.zombie_vars["zombie_powerup_fire_sale_on"] && self [[level._zombiemode_check_firesale_loc_valid_func]]())
    	{
    		self set_hint_string( self, "powerup_fire_sale_cost" );
    	}
    	else
    	{
    		self set_hint_string( self, "default_treasure_chest_" + self.zombie_cost );
    	}
    	self setCursorHint( "HINT_NOICON" );
    
    	user = undefined;
    	user_cost = undefined;
    	self.box_rerespun = undefined;
    	self.weapon_out = undefined;
    
    	while( 1 )
    	{
    		if(!IsDefined(self.forced_user))
    		{
    			self waittill( "trigger", user ); 
    		}
    		else
    		{
    			user = self.forced_user;
    		}
    		if( user in_revive_trigger() )
    		{
    			wait( 0.1 );
    			continue;
    		}
    		if( user is_drinking() )
    		{
    			wait( 0.1 );
    			continue;
    		}
    		if ( is_true( self.disabled ) )
    		{
    			wait( 0.1 );
    			continue;
    		}
    		if( user GetCurrentWeapon() == "none" )
    		{
    			wait( 0.1 );
    			continue;
    		}
    		if( IsDefined(self.auto_open) && is_player_valid( user ) )
    		{
    			if(!IsDefined(self.no_charge))
    			{
    				user maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
    				user_cost = self.zombie_cost; 
    			}
    			else
    			{
    				user_cost = 0;
    			}			
    			
    			self.chest_user = user;
    			break;
    		}
    		else if( is_player_valid( user ) && user.score >= self.zombie_cost )
    		{
    			user maps\_zombiemode_score::minus_to_player_score( self.zombie_cost );
    			user_cost = self.zombie_cost; 
    			self.chest_user = user;
    			break; 
    		}
    		else if ( user.score < self.zombie_cost )
    		{
    			user maps\_zombiemode_audio::create_and_play_dialog( "general", "no_money", undefined, 2 );
    			continue;	
    		}
    
    		wait 0.05; 
    	}
    
    	flag_set("chest_has_been_used");
    	self._box_open = true;
    	self._box_opened_by_fire_sale = false;
    	if ( is_true( level.zombie_vars["zombie_powerup_fire_sale_on"] ) && !IsDefined(self.auto_open) && self [[level._zombiemode_check_firesale_loc_valid_func]]())
    	{
    		self._box_opened_by_fire_sale = true;
    	}
    
    	self.chest_lid thread maps\_zombiemode_weapons::treasure_chest_lid_open();
    
    	self.timedOut = false;
    
    	self.weapon_out = true;
    	self.chest_origin thread maps\_zombiemode_weapons::treasure_chest_weapon_spawn( self, user ); 
    
    	self.chest_origin thread maps\_zombiemode_weapons::treasure_chest_glowfx(); 
    
    	self disable_trigger(); 
    
    	self.chest_origin waittill( "randomization_done" ); 
    
    	if (flag("moving_chest_now") && !self._box_opened_by_fire_sale && IsDefined(user_cost))
    	{
    		user maps\_zombiemode_score::add_to_player_score( user_cost, false );
    	}
    
    	if (flag("moving_chest_now") && !level.zombie_vars["zombie_powerup_fire_sale_on"])
    	{
    
    		self thread maps\_zombiemode_weapons::treasure_chest_move( self.chest_user );
    	}
    	else
    	{
    		self.grab_weapon_hint = true;
    		self.chest_user = user;
            self sethintstring( "Hold ^3&&1^7 for Weapon ^1or ^7Press ^3[{+melee}]^7 to let teammates pick it up" ); 		
    		self setCursorHint( "HINT_NOICON" ); 
    		
    		self thread maps\_zombiemode_weapons::decide_hide_show_hint( "weapon_grabbed");
    
    		self enable_trigger(); 
    		self thread maps\_zombiemode_weapons::treasure_chest_timeout();
    
    		for( i=0;i<105;i++ )
    		{
    			if(user meleeButtonPressed() && isplayer( user ) && distance(self.origin, user.origin) <= 100)
    			{
                    self sethintstring( &"ZOMBIE_TRADE_WEAPONS" ); 
                    self setvisibletoall();
    				level.shared_box = 1;
    				for( a=i;a<105;a++ )
    				{
                        players = get_players();
    					for(x=0;x<players.size;x++)
    					{
    						if(players[x] usebuttonpressed() && distance(self.origin, players[x].origin) <= 100 && isDefined( players[x].is_drinking ) && !players[x].is_drinking)
    						{
    							players[x] thread maps\_zombiemode_weapons::treasure_chest_give_weapon( self.chest_origin.weapon_string );
    							a = 105;
    							break;
    						}
    					}
    					wait 0.1;
    				}
    				break;
    			}
    			if(user usebuttonpressed() && isplayer( user ) && distance(self.origin, user.origin) <= 100 && isDefined( user.is_drinking ) && !user.is_drinking)
    			{
    				user thread maps\_zombiemode_weapons::treasure_chest_give_weapon( self.chest_origin.weapon_string );
    				break;
    			}
    			wait 0.1;
    		}
    
    		self.grab_weapon_hint = false;
    		self.chest_origin notify( "weapon_grabbed" );
    
    		if ( !is_true( self._box_opened_by_fire_sale ) )
    		{
    			level.chest_accessed += 1;
    		}
    		if( level.chest_moves > 0 && isDefined(level.pulls_since_last_ray_gun) )
    		{
    			level.pulls_since_last_ray_gun += 1;
    		}
    		if( isDefined(level.pulls_since_last_tesla_gun) )
    		{				
    			level.pulls_since_last_tesla_gun += 1;
    		}
    
    		self disable_trigger();
    
    		self.chest_lid thread maps\_zombiemode_weapons::treasure_chest_lid_close( self.timedOut );
    
    		wait 3;
    		if ( (is_true( level.zombie_vars["zombie_powerup_fire_sale_on"] ) && self [[level._zombiemode_check_firesale_loc_valid_func]]()) || self == level.chests[level.chest_index] )
    		{
    			self enable_trigger();
    			self setvisibletoall();
    		}
    	}
    
    	self._box_open = false;
    	self._box_opened_by_fire_sale = false;
    	self.chest_user = undefined;
    	
    	self notify( "chest_accessed" );
    	
    	self thread custom_treasure_chest_think();
    }
    

    Discord

  • It does freeze when i start bo1 when i tried it

  • @UnlockedHome did you try this?

    If you have issues starting Plutonium Black ops 1 while the file is in the folder remove the file and start the game. After game is running you can place the script back.
    
    (I could not start the game while the file was already in the folder. I guess it will be fixed later if more people has same issue)
    
  • yes, it worked when i did that but i just wanted to let you know it crashed with it on before starting (which can be a hassle for the long term). other than that it works.

  • @UnlockedHome The issue is on plutoniums end i cannot fix it. Most likely will be fixed by mod support.

    If you want to load it without hassle i guess you can copy the code to some game file like "_zombiemode_weapons.gsc" and add it to

    "%Localappdata%\Plutonium\storage\t5\maps"
    

    which should replace the original game file on start up.

  • now this is what i call community greatest work ๐Ÿ‘

  • If you want to use this script without hassle before the issue has been fixed here is guide.

    Download and copy this file to %localappdata%\Plutonium\storage\t5\maps that will replace the original game file without touching game files.

    Download

Log in to reply