Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //BBP Cement Mixers -Begin Part1-
- void SpawnObject( string type, vector position, vector orientation )
- {
- auto obj = GetGame().CreateObject( type, position );
- obj.SetPosition( position );
- obj.SetOrientation( orientation );
- //Force collision update
- vector roll = obj.GetOrientation();
- roll [ 2 ] = roll [ 2 ] - 1;
- obj.SetOrientation( roll );
- roll [ 2 ] = roll [ 2 ] + 1;
- obj.SetOrientation( roll );
- }
- //BBP Cement Mixers -End Part1-
- #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\CustomBridgePrison.c"
- void main()
- {
- //INIT WEATHER BEFORE ECONOMY INIT------------------------
- Weather weather = g_Game.GetWeather();
- weather.MissionWeather(true); // 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);
- weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.0), 0, 0);
- weather.GetRain().Set( 0, 0, 0);
- weather.GetFog().Set( Math.RandomFloatInclusive(0.00, 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);
- }
- }
- }
- BridgePrison();
- //GetCEApi().ExportProxyData( "7500 0 7500", 10000 ); //Centre of map, radius of how far to go out and find buildings.
- }
- class CustomMission: MissionServer
- {
- void SetRandomHealth(EntityAI itemEnt)
- {
- int rndHlt = Math.RandomInt(40,100);
- itemEnt.SetHealth("","",rndHlt);
- }
- void SetHealth(EntityAI itemEnt, int health)
- {
- itemEnt.SetHealth("","",health);
- }
- 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)
- {
- TStringArray gun = {"Glock19"};
- TStringArray tops = {"HikingJacket_Blue","HikingJacket_Green","HikingJacket_Red"};
- TStringArray pants = {"Jeans_Black","Jeans_BlueDark","Jeans_Blue","Jeans_Brown","Jeans_Green","Jeans_Grey"};
- TStringArray shoes = {"AthleticShoes_Black","AthleticShoes_Blue","AthleticShoes_Brown","AthleticShoes_Green","AthleticShoes_Grey","HikingBootsLow_Beige","HikingBootsLow_Black","HikingBootsLow_Blue","HikingBootsLow_Grey","HikingBoots_Black","HikingBoots_Brown","HikingJacket_Black"};
- TStringArray tool = {"OrienteeringCompass","Knife","PurificationTablets","Matchbox"};
- TStringArray medic = {"Rags","BandageDressing"};
- TStringArray drink = {"SodaCan_Cola","SodaCan_Kvass","SodaCan_Pipsi","SodaCan_Spite"};
- TStringArray food = {"Plum","Pear","BoxCerealCrunchin","Banana","Orange"};
- TStringArray ammo = {"Mag_Glock_15Rnd"};
- player.RemoveAllItems();
- EntityAI itemEnt;
- EntityAI itemIn;
- ItemBase itemBs;
- EntityAI item = player.GetInventory().CreateInInventory(gun.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetHealth(itemEnt, 20);
- EntityAI item1 = player.GetInventory().CreateInInventory(tops.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetHealth(itemEnt, 20);
- EntityAI item2 = player.GetInventory().CreateInInventory(pants.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetHealth(itemEnt, 20);
- EntityAI item3 = player.GetInventory().CreateInInventory(shoes.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetHealth(itemEnt, 20);
- itemEnt = player.GetInventory().CreateInInventory(tool.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory(medic.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory(drink.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory(drink.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory(drink.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory(food.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory(food.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory(food.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory(ammo.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- itemEnt = player.GetInventory().CreateInInventory(ammo.GetRandomElement());
- itemBs = ItemBase.Cast(itemEnt);
- SetRandomHealth(itemEnt);
- }
- };
- Mission CreateCustomMission(string path)
- {
- return new CustomMission();
- }
Add Comment
Please, Sign In to add comment