Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main()
- {
- //INIT WEATHER BEFORE ECONOMY INIT------------------------
- Weather weather = g_Game.GetWeather();
- weather.MissionWeather(false); // false = use weather controller from Weather.c
- weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
- weather.GetRain().Set( 0, 0, 1);
- weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
- //INIT ECONOMY--------------------------------------
- Hive ce = CreateHive();
- if ( ce )
- ce.InitOffline();
- //DATE RESET AFTER ECONOMY INIT-------------------------
- int year, month, day, hour, minute;
- int reset_month = 9, reset_day = 20;
- GetGame().GetWorld().GetDate(year, month, day, hour, minute);
- if ((month == reset_month) && (day < reset_day))
- {
- GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
- }
- else
- {
- if ((month == reset_month + 1) && (day > reset_day))
- {
- GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
- }
- else
- {
- if ((month < reset_month) || (month > reset_month + 1))
- {
- GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
- }
- }
- }
- }
- class CustomMission: MissionServer
- {
- void SetRandomHealth(EntityAI itemEnt)
- {
- if ( itemEnt )
- {
- float rndHlt = Math.RandomFloat( 0.45, 0.65 );
- itemEnt.SetHealth01( "", "", rndHlt );
- }
- }
- override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
- {
- Entity playerEnt;
- playerEnt = GetGame().CreatePlayer( identity, characterName, pos, 0, "NONE" );
- Class.CastTo( m_player, playerEnt );
- GetGame().SelectPlayer( identity, m_player );
- return m_player;
- }
- override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
- {
- player.RemoveAllItems();
- // Jacket
- private EntityAI clothesJacket;
- clothesJacket = player.GetInventory().CreateInInventory("HikingJacket_Black");
- clothesJacket.GetInventory().CreateInInventory("SteakKnife");
- clothesJacket.GetInventory().CreateInInventory("TunaCan");
- clothesJacket.GetInventory().CreateInInventory("WaterBottle");
- clothesJacket.GetInventory().CreateInInventory("Rag");
- // Pants
- private EntityAI clothesPants;
- clothesPants = player.GetInventory().CreateInInventory("Jeans_Blue");
- // Boots
- private EntityAI clothesBoots;
- clothesBoots = player.GetInventory().CreateInInventory("WorkingBoots_Brown");
- }
- };
- Mission CreateCustomMission(string path)
- {
- return new CustomMission();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement