Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Support & Discussion
  3. Script for making perma Jug not stack?

Script for making perma Jug not stack?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
3 Posts 2 Posters 164 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Dragon115undefined Offline
    Dragon115undefined Offline
    Dragon115
    wrote on last edited by
    #1

    Perma jug stacking with jug is a little strong imo and I wanted to change it any ideas? I tried creating an if statement to check for the player health being at 340 and setting it to 250 but it didn't work. Any advice is appeciated.

    JezuzLizardundefined 1 Reply Last reply
    0
    • Dragon115undefined Dragon115

      Perma jug stacking with jug is a little strong imo and I wanted to change it any ideas? I tried creating an if statement to check for the player health being at 340 and setting it to 250 but it didn't work. Any advice is appeciated.

      JezuzLizardundefined Offline
      JezuzLizardundefined Offline
      JezuzLizard
      Plutonium Staff
      wrote on last edited by
      #2

      Dragon115
      Try this code:

      main()
      {
      	replaceFunc( maps/mp/zombies/_zm_perks::perk_set_max_health_if_jugg, ::perk_set_max_health_if_jugg_override );
      }
      
      perk_set_max_health_if_jugg_override( perk, set_premaxhealth, clamp_health_to_max_health ) //checked matches cerberus output
      {
      	max_total_health = undefined;
      	if ( perk == "specialty_armorvest" )
      	{
      		if ( set_premaxhealth )
      		{
      			self.premaxhealth = self.maxhealth;
      		}
      		max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
      	}
      	else if ( perk == "specialty_armorvest_upgrade" )
      	{
      		if ( set_premaxhealth )
      		{
      			self.premaxhealth = self.maxhealth;
      		}
      		max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health_upgrade" ];
      	}
      	else if ( perk == "jugg_upgrade" )
      	{
      		if ( set_premaxhealth )
      		{
      			self.premaxhealth = self.maxhealth;
      		}
      		if ( self hasperk( "specialty_armorvest" ) )
      		{
      			max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
      		}
      		else
      		{
      			max_total_health = 100;
      		}
      	}
      	else
      	{
      		if ( perk == "health_reboot" )
      		{
      			max_total_health = 100;
      		}
      	}
      	if ( isDefined( max_total_health ) )
      	{
      		if ( self maps/mp/zombies/_zm_pers_upgrades_functions::pers_jugg_active() && !hasPerk( "specialty_armorvest" ) )
      		{
      			max_total_health += level.pers_jugg_upgrade_health_bonus;
      		}
      		self setmaxhealth( max_total_health );
      		if ( isDefined( clamp_health_to_max_health ) && clamp_health_to_max_health == 1 )
      		{
      			if ( self.health > self.maxhealth )
      			{
      				self.health = self.maxhealth;
      			}
      		}
      	}
      }
      
      Dragon115undefined 1 Reply Last reply
      1
      • JezuzLizardundefined JezuzLizard

        Dragon115
        Try this code:

        main()
        {
        	replaceFunc( maps/mp/zombies/_zm_perks::perk_set_max_health_if_jugg, ::perk_set_max_health_if_jugg_override );
        }
        
        perk_set_max_health_if_jugg_override( perk, set_premaxhealth, clamp_health_to_max_health ) //checked matches cerberus output
        {
        	max_total_health = undefined;
        	if ( perk == "specialty_armorvest" )
        	{
        		if ( set_premaxhealth )
        		{
        			self.premaxhealth = self.maxhealth;
        		}
        		max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
        	}
        	else if ( perk == "specialty_armorvest_upgrade" )
        	{
        		if ( set_premaxhealth )
        		{
        			self.premaxhealth = self.maxhealth;
        		}
        		max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health_upgrade" ];
        	}
        	else if ( perk == "jugg_upgrade" )
        	{
        		if ( set_premaxhealth )
        		{
        			self.premaxhealth = self.maxhealth;
        		}
        		if ( self hasperk( "specialty_armorvest" ) )
        		{
        			max_total_health = level.zombie_vars[ "zombie_perk_juggernaut_health" ];
        		}
        		else
        		{
        			max_total_health = 100;
        		}
        	}
        	else
        	{
        		if ( perk == "health_reboot" )
        		{
        			max_total_health = 100;
        		}
        	}
        	if ( isDefined( max_total_health ) )
        	{
        		if ( self maps/mp/zombies/_zm_pers_upgrades_functions::pers_jugg_active() && !hasPerk( "specialty_armorvest" ) )
        		{
        			max_total_health += level.pers_jugg_upgrade_health_bonus;
        		}
        		self setmaxhealth( max_total_health );
        		if ( isDefined( clamp_health_to_max_health ) && clamp_health_to_max_health == 1 )
        		{
        			if ( self.health > self.maxhealth )
        			{
        				self.health = self.maxhealth;
        			}
        		}
        	}
        }
        
        Dragon115undefined Offline
        Dragon115undefined Offline
        Dragon115
        wrote on last edited by
        #3

        JezuzLizard Actually figured it out by having the script check for if you bought jug and set your health to 250. I appreciate this though because it helps me learn.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Donate