ElDubya

Untitled

May 16th, 2020
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.29 KB | None | 0 0
  1. //BBP Cement Mixers -Begin Part1-
  2. void SpawnObject( string type, vector position, vector orientation )
  3. {
  4.     auto obj = GetGame().CreateObject( type, position );
  5.     obj.SetPosition( position );
  6.     obj.SetOrientation( orientation );
  7.     //Force collision update
  8.     vector roll = obj.GetOrientation();
  9.     roll [ 2 ] = roll [ 2 ] - 1;
  10.     obj.SetOrientation( roll );
  11.     roll [ 2 ] = roll [ 2 ] + 1;
  12.     obj.SetOrientation( roll );
  13. }
  14. //BBP Cement Mixers -End Part1-
  15.  
  16. #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\CustomBridgePrison.c"
  17.  
  18. void main()
  19. {  
  20.     //INIT WEATHER BEFORE ECONOMY INIT------------------------
  21.     Weather weather = g_Game.GetWeather();
  22.  
  23.     weather.MissionWeather(true);    // false = use weather controller from Weather.c
  24.  
  25.     //weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
  26.     //weather.GetRain().Set( 0, 0, 1);
  27.     //weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
  28.    
  29.     weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.0), 0, 0);
  30.     weather.GetRain().Set( 0, 0, 0);
  31.     weather.GetFog().Set( Math.RandomFloatInclusive(0.00, 0.0), 0, 0); 
  32.    
  33.  
  34.     //INIT ECONOMY--------------------------------------
  35.     Hive ce = CreateHive();
  36.     if ( ce )
  37.         ce.InitOffline();
  38.  
  39.     //DATE RESET AFTER ECONOMY INIT-------------------------
  40.     int year, month, day, hour, minute;
  41.     int reset_month = 9, reset_day = 20;
  42.     GetGame().GetWorld().GetDate(year, month, day, hour, minute);
  43.  
  44.     if ((month == reset_month) && (day < reset_day))
  45.     {
  46.         GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  47.     }
  48.     else
  49.     {
  50.         if ((month == reset_month + 1) && (day > reset_day))
  51.         {
  52.             GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  53.         }
  54.         else
  55.         {
  56.             if ((month < reset_month) || (month > reset_month + 1))
  57.             {
  58.                 GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  59.             }
  60.         }
  61.     }
  62.    
  63.     BridgePrison();
  64.     //GetCEApi().ExportProxyData( "7500 0 7500", 10000 );  //Centre of map, radius of how far to go out and find buildings.
  65.    
  66. }
  67.  
  68. class CustomMission: MissionServer
  69. {  
  70.     void SetRandomHealth(EntityAI itemEnt)
  71.     {
  72.         int rndHlt = Math.RandomInt(40,100);
  73.         itemEnt.SetHealth("","",rndHlt);
  74.     }
  75.    
  76.     void SetHealth(EntityAI itemEnt, int health)
  77.     {
  78.         itemEnt.SetHealth("","",health);
  79.     }
  80.  
  81.     override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
  82.     {
  83.         Entity playerEnt;
  84.         playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
  85.         Class.CastTo(m_player, playerEnt);
  86.        
  87.         GetGame().SelectPlayer(identity, m_player);
  88.        
  89.         return m_player;
  90.     }
  91.    
  92.    
  93.    
  94.     override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
  95.     {
  96.  
  97.         TStringArray gun = {"Glock19"};
  98.         TStringArray tops = {"HikingJacket_Blue","HikingJacket_Green","HikingJacket_Red"};
  99.         TStringArray pants = {"Jeans_Black","Jeans_BlueDark","Jeans_Blue","Jeans_Brown","Jeans_Green","Jeans_Grey"};
  100.         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"};
  101.         TStringArray tool = {"OrienteeringCompass","Knife","PurificationTablets","Matchbox"};
  102.         TStringArray medic = {"Rags","BandageDressing"};
  103.         TStringArray drink = {"SodaCan_Cola","SodaCan_Kvass","SodaCan_Pipsi","SodaCan_Spite"};
  104.         TStringArray food = {"Plum","Pear","BoxCerealCrunchin","Banana","Orange"};
  105.         TStringArray ammo = {"Mag_Glock_15Rnd"};
  106.        
  107.         player.RemoveAllItems();      
  108.        
  109.         EntityAI itemEnt;
  110.         EntityAI itemIn;
  111.         ItemBase itemBs;
  112.        
  113.         EntityAI item = player.GetInventory().CreateInInventory(gun.GetRandomElement());
  114.         itemBs = ItemBase.Cast(itemEnt);
  115.         SetHealth(itemEnt, 20);
  116.        
  117.         EntityAI item1 = player.GetInventory().CreateInInventory(tops.GetRandomElement());
  118.         itemBs = ItemBase.Cast(itemEnt);
  119.         SetHealth(itemEnt, 20);
  120.        
  121.         EntityAI item2 = player.GetInventory().CreateInInventory(pants.GetRandomElement());
  122.         itemBs = ItemBase.Cast(itemEnt);
  123.         SetHealth(itemEnt, 20);
  124.        
  125.         EntityAI item3 = player.GetInventory().CreateInInventory(shoes.GetRandomElement());
  126.         itemBs = ItemBase.Cast(itemEnt);
  127.         SetHealth(itemEnt, 20);
  128.                
  129.         itemEnt = player.GetInventory().CreateInInventory(tool.GetRandomElement());
  130.         itemBs = ItemBase.Cast(itemEnt);
  131.         SetRandomHealth(itemEnt);
  132.  
  133.         itemEnt = player.GetInventory().CreateInInventory(medic.GetRandomElement());
  134.         itemBs = ItemBase.Cast(itemEnt);
  135.         SetRandomHealth(itemEnt);
  136.  
  137.         itemEnt = player.GetInventory().CreateInInventory(drink.GetRandomElement());
  138.         itemBs = ItemBase.Cast(itemEnt);
  139.         SetRandomHealth(itemEnt);
  140.        
  141.         itemEnt = player.GetInventory().CreateInInventory(drink.GetRandomElement());
  142.         itemBs = ItemBase.Cast(itemEnt);
  143.         SetRandomHealth(itemEnt);
  144.  
  145.         itemEnt = player.GetInventory().CreateInInventory(drink.GetRandomElement());
  146.         itemBs = ItemBase.Cast(itemEnt);
  147.         SetRandomHealth(itemEnt);      
  148.  
  149.         itemEnt = player.GetInventory().CreateInInventory(food.GetRandomElement());
  150.         itemBs = ItemBase.Cast(itemEnt);
  151.         SetRandomHealth(itemEnt);
  152.        
  153.         itemEnt = player.GetInventory().CreateInInventory(food.GetRandomElement());
  154.         itemBs = ItemBase.Cast(itemEnt);
  155.         SetRandomHealth(itemEnt);
  156.  
  157.         itemEnt = player.GetInventory().CreateInInventory(food.GetRandomElement());
  158.         itemBs = ItemBase.Cast(itemEnt);
  159.         SetRandomHealth(itemEnt);      
  160.        
  161.         itemEnt = player.GetInventory().CreateInInventory(ammo.GetRandomElement());
  162.         itemBs = ItemBase.Cast(itemEnt);
  163.         SetRandomHealth(itemEnt);
  164.        
  165.         itemEnt = player.GetInventory().CreateInInventory(ammo.GetRandomElement());
  166.         itemBs = ItemBase.Cast(itemEnt);
  167.         SetRandomHealth(itemEnt);      
  168.        
  169.     }
  170. };
  171.  
  172. Mission CreateCustomMission(string path)
  173. {
  174.     return new CustomMission();
  175. }
Add Comment
Please, Sign In to add comment