Jump to content
Violt

[SCRIPT] Seasonal Loadouts

Recommended Posts

Hey Guys, i made a script that makes the bambi loadout adapt to the ingame month. 

So if it is the between the 4th and 10th month (4th and 10th don't count) You will get a t shirt. 

If it isn't you will get a jacket for the cold 🙂

here's the script: 

	override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
	{
		//EntityAI itemClothing;
		EntityAI itemTop;
		EntityAI itemEnt;
		ItemBase itemBs;
		float randfood;
		float randdrink;
		float randshirt;
		float randpants;
		float randbag;
		int year, month, day, hour, minute;
		int reset_year = 2022;
		GetGame().GetWorld().GetDate(year, month, day, hour, minute);

		itemTop = player.FindAttachmentBySlotName( "Body" );
		//if ( itemClothing )
		if ( itemTop )
		{	
			player.RemoveAllItems();
		
			randpants = Math.RandomFloatInclusive( 0.0, 1.0 );
			if ( randpants < 0.35 )
				itemEnt = player.GetInventory().CreateInInventory( "Jeans_BlueDark" );
			else if ( randpants > 0.65 )
				itemEnt = player.GetInventory().CreateInInventory( "Jeans_Blue" );
			else
				itemEnt = player.GetInventory().CreateInInventory( "Jeans_Black" );
			
			if ((month > 4) && (month < 10)
			{
				Print("[Season Clothing] Random T-Shirt given");
				
				randshirt = Math.RandomFloatInclusive( 0.0, 1.0 );
				if ( randshirt < 0.35 )
					itemEnt = player.GetInventory().CreateInInventory( "TShirt_Red" );
				else if ( randshirt > 0.65 )
					itemEnt = player.GetInventory().CreateInInventory( "TShirt_Black" );
				else
					itemEnt = player.GetInventory().CreateInInventory( "TShirt_Green" );	
			}
			else
			{
				Print("[Season Clothing] Jacket given");
				itemEnt = player.GetInventory().CreateInInventory( "Winter_Parka_Base" );
				itemEnt = player.GetInventory().CreateInInventory( "Heatpack" );
			}
			
						//Adds Drinks
			randdrink = Math.RandomFloatInclusive( 0.0, 1.0 );
			if ( randdrink < 0.35 )
				itemEnt = player.GetInventory().CreateInInventory( "SodaCan_Cola" );
			else if ( randdrink > 0.65 )
				itemEnt = player.GetInventory().CreateInInventory( "SodaCan_Pipsi" );
			else
				itemEnt = player.GetInventory().CreateInInventory( "SodaCan_Kvass" );
			
			//Adds Food
			randfood = Math.RandomFloatInclusive( 0.0, 1.0 );
			if ( randfood < 0.35 )
				itemEnt = player.GetInventory().CreateInInventory( "SpaghettiCan" );
			else if ( randfood > 0.65 )
				itemEnt = player.GetInventory().CreateInInventory( "BakedBeansCan" );
			else
				itemEnt = player.GetInventory().CreateInInventory( "PeachesCan" );		
			
			
			randbag = Math.RandomFloatInclusive( 0.0, 1.0 );
			if ( randbag < 0.35 )
				itemEnt = player.GetInventory().CreateInInventory( "CourierBag" );
			else if ( randbag > 0.65 )
				Print("[Random Backpack] No backpack for you my friend.");
			else
				Print("[Random Backpack] No backpack for you my friend.");
			
			//Items
			itemEnt = player.GetInventory().CreateInInventory( "CanOpener" );
			itemEnt = player.GetInventory().CreateInInventory( "BandageDressing" );
			itemEnt = player.GetInventory().CreateInInventory( "Flashlight" );
			itemEnt = player.GetInventory().CreateInInventory( "Battery9V" );
			itemEnt = player.GetInventory().CreateInInventory( "Roadflare" );
			itemEnt = player.GetInventory().CreateInInventory( "StoneKnife" );
			itemEnt = player.GetInventory().CreateInInventory( "AthleticShoes_Black" );
			
		}
	}
};

 

Edited by Violt

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×