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().SetLimits( 0.0 , 0.0 );
- weather.GetRain().SetLimits( 0.0 , 0.0 );
- weather.GetFog().SetLimits( 0.0 , 0.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 )
- {
- int rndHlt = Math.RandomInt(55,100);
- itemEnt.SetHealth("","",rndHlt);
- }
- }
- override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
- {
- Entity playerEnt;
- playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
- Class.CastTo(m_player, playerEnt);
- GetGame().SelectPlayer(identity, m_player);
- return m_player;
- }
- override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
- {
- EntityAI itemTop;
- EntityAI itemEnt;
- ItemBase itemBs;
- float rand;
- player.RemoveAllItems();
- itemEnt = player.GetInventory().CreateInInventory("USMCJacket_Woodland");
- itemEnt = player.GetInventory().CreateInInventory("USMCPants_Woodland");
- itemEnt = player.GetInventory().CreateInInventory("AliceBag_Black");
- itemEnt = player.GetInventory().CreateInInventory("CombatBoots_Black");
- itemEnt = player.GetInventory().CreateInInventory("TacticalGloves_Black");
- itemEnt = player.GetInventory().CreateInInventory("BoonieHat_DPM");
- itemEnt = player.GetInventory().CreateInInventory("MilitaryBelt");
- itemEnt = player.GetInventory().CreateInInventory("NylonKnifeSheath");
- itemEnt = player.GetInventory().CreateInInventory("Canteen");
- itemEnt = player.GetInventory().CreateInInventory("PlateCarrierHolster");
- itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Olive");
- itemTop = player.FindAttachmentBySlotName("Body");
- if ( itemTop )
- {
- itemEnt = itemTop.GetInventory().CreateInInventory("Rag");
- if ( Class.CastTo(itemBs, itemEnt ) )
- itemBs.SetQuantity(6);
- itemEnt = player.GetInventory().CreateInInventory("Colt1911");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Binoculars");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Ammo_45ACP");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Ammo_45ACP");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Battery9V");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("PersonalRadio");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Ammo_45ACP");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("UMP45");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Mag_UMP_25Rnd");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Mag_UMP_25Rnd");
- itemBs = ItemBase.Cast(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory("Mag_UMP_25Rnd");
- itemBs = ItemBase.Cast(itemEnt);
- string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" };
- int rndIndex = Math.RandomInt(2, 4);
- itemEnt = itemTop.GetInventory().CreateInInventory(chemlightArray[rndIndex]);
- SetRandomHealth(itemEnt);
- rand = Math.RandomFloatInclusive(0.0, 1.0);
- if ( rand < 0.35 )
- itemEnt = player.GetInventory().CreateInInventory("Apple");
- else if ( rand > 0.65 )
- itemEnt = player.GetInventory().CreateInInventory("Pear");
- else
- itemEnt = player.GetInventory().CreateInInventory("Plum");
- SetRandomHealth(itemEnt);
- }
- }
- };
- Mission CreateCustomMission(string path)
- {
- return new CustomMission();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement