Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. /*
  2. class CustomMission: MissionGameplay
  3. {
  4. void CustomMission()
  5. {
  6. }
  7. };
  8.  
  9. Mission CreateCustomMission(string path)
  10. {
  11. return new CustomMission();
  12. }
  13. */
  14.  
  15. void SetRandomHealth(EntityAI itm)
  16. {
  17. int rndHlt = Math.RandomInt(40,100);
  18. itm.SetHealth("","",rndHlt);
  19. }
  20.  
  21. void main()
  22. {
  23. vector player_pos;
  24. int index;
  25. TVectorArray positions = {"2383.05 0 7945.36"};
  26.  
  27. TStringArray tops = {"Hoodie_Blue","Hoodie_Black","Hoodie_Brown","Hoodie_Green","Hoodie_Grey","Hoodie_Red"};
  28. TStringArray pants = {"Jeans_Black","Jeans_BlueDark","Jeans_Blue","Jeans_Brown","Jeans_Green","Jeans_Grey","CanvasPants_Beige","CanvasPants_Blue","CanvasPants_Grey"};
  29. TStringArray shoes = {"AthleticShoes_Black","AthleticShoes_Blue","AthleticShoes_Brown","AthleticShoes_Green","AthleticShoes_Grey"};
  30.  
  31. Print(positions);
  32.  
  33. index = Math.RandomInt(0, positions.Count() );
  34.  
  35.  
  36. player_pos = positions.Get(index);
  37. Print(player_pos);
  38. Entity playerEnt = GetGame().CreatePlayer( NULL, GetGame().CreateRandomPlayer(), player_pos, 0, "NONE");
  39.  
  40. PlayerBase player = (PlayerBase) playerEnt;
  41.  
  42. EntityAI item = player.GetInventory().CreateInInventory(tops.GetRandomElement());
  43. EntityAI item2 = player.GetInventory().CreateInInventory(pants.GetRandomElement());
  44. EntityAI item3 = player.GetInventory().CreateInInventory(shoes.GetRandomElement());
  45.  
  46. EntityAI itemEnt;
  47. EntityAI itemIn;
  48. ItemBase itemBs;
  49. int rndQnt;
  50.  
  51. itemEnt = player.GetInventory().CreateInInventory("Rag");
  52. itemBs = ItemBase.Cast(itemEnt);
  53. itemBs.SetQuantity(4);
  54. SetRandomHealth(itemEnt);
  55.  
  56. itemEnt = player.GetInventory().CreateInInventory("Mag_IJ70_8Rnd");
  57. SetRandomHealth(itemEnt);
  58.  
  59. itemEnt = player.GetInventory().CreateInInventory("HuntingKnife");
  60. SetRandomHealth(itemEnt);
  61.  
  62. itemEnt = player.GetInventory().CreateInInventory("MakarovIJ70");
  63. SetRandomHealth(itemEnt);
  64. player.SetQuickBarEntityShortcut(itemEnt, 2);
  65.  
  66. itemIn = itemEnt.GetInventory().CreateAttachment("Mag_IJ70_8Rnd");
  67. SetRandomHealth(itemIn);
  68.  
  69. itemEnt = player.GetInventory().CreateInInventory("Izh18");
  70. SetRandomHealth(itemEnt);
  71. player.SetQuickBarEntityShortcut(itemEnt, 0);
  72.  
  73. itemBs = ItemBase.Cast(itemEnt);
  74. itemBs.SetQuantity(rndQnt);
  75.  
  76. itemEnt = player.GetInventory().CreateInInventory("Ammo_762x39");
  77. rndQnt = Math.RandomInt(5,20);
  78. SetRandomHealth(itemEnt);
  79. player.SetQuickBarEntityShortcut(itemEnt, 1);
  80.  
  81. itemEnt = player.GetInventory().CreateInInventory("Ammo_380");
  82. SetRandomHealth(itemEnt);
  83.  
  84. GetGame().SelectPlayer(NULL, player);
  85.  
  86. //INIT WEATHER BEFORE ECONOMY INIT------------------------
  87. Weather weather = g_Game.GetWeather();
  88.  
  89. weather.MissionWeather(false); // false = use weather controller from Weather.c
  90.  
  91. weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
  92. weather.GetRain().Set( 0, 0, 1);
  93. weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
  94.  
  95. //INIT ECONOMY--------------------------------------
  96. Hive myHive = CreateHive();
  97. if( myHive )
  98. {
  99. myHive.InitOffline();
  100. }
  101.  
  102. //DATE RESET AFTER ECONOMY INIT-------------------------
  103. int year;
  104. int month;
  105. int day;
  106. int hour;
  107. int minute;
  108.  
  109. GetGame().GetWorld().GetDate(year, month, day, hour, minute);
  110.  
  111. GetTesting().ExportProxyData("7500 0 7500", 10000); //Centre of map, radius of how far to go out and find buildings.
  112.  
  113. if (((month <= 9) && (day < 20)) || ((month >= 10) && (day > 20)))
  114. {
  115. month = 9;
  116. day = 20;
  117.  
  118. GetGame().GetWorld().SetDate(year, month, day, hour, minute);
  119. }
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement