Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1.  
  2. void main()
  3. {
  4.  
  5. Hive ce = CreateHive();
  6. if ( ce )
  7. ce.InitOffline();
  8.  
  9. Weather weather = g_Game.GetWeather();
  10.  
  11. weather.GetOvercast().SetLimits( 0.0 , 1.0 );
  12. weather.GetRain().SetLimits( 0.0 , 1.0 );
  13. weather.GetFog().SetLimits( 0.0 , 0.25 );
  14.  
  15. weather.GetOvercast().SetForecastChangeLimits( 0.0, 0.2 );
  16. weather.GetRain().SetForecastChangeLimits( 0.0, 0.1 );
  17. weather.GetFog().SetForecastChangeLimits( 0.15, 0.45 );
  18.  
  19. weather.GetOvercast().SetForecastTimeLimits( 1800 , 1800 );
  20. weather.GetRain().SetForecastTimeLimits( 600 , 600 );
  21. weather.GetFog().SetForecastTimeLimits( 1800 , 1800 );
  22.  
  23. weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.3), 0, 0);
  24. weather.GetRain().Set( Math.RandomFloatInclusive(0.0, 0.2), 0, 0);
  25. weather.GetFog().Set( Math.RandomFloatInclusive(0.0, 0.1), 0, 0);
  26.  
  27. weather.SetWindMaximumSpeed(30);
  28. weather.SetWindFunctionParams(0.1, 1.0, 50);
  29. }
  30.  
  31. class CustomMission: MissionServer
  32. {
  33.  
  34. // This is the member
  35. ref EternalDay m_EternalDay;
  36.  
  37. // This is the Constructor, by default, CustomMission don't have one. It's called when class CustoMission is created.
  38. void CustomMission()
  39. {
  40. // We create the reference of the class EternalDay, and linked it to the class member named: 'm_EternalDay'
  41. m_EternalDay = new ref EternalDay();
  42.  
  43. /* We can set a new specific time slot if we want too
  44.  
  45. m_EternalDay.setDayTime(6.5, 12.75); // This set time slot from 6:30AM to 12:45PM
  46.  
  47. m_EternalDay.setRandomTime(); // Set a random time between time slot [WIP]
  48. m_EternalDay.setRandomDate(); // Set a random date [WIP]
  49. */
  50. }
  51.  
  52. void SetRandomHealth(EntityAI itemEnt)
  53. {
  54. int rndHlt = Math.RandomInt(40,100);
  55. itemEnt.SetHealth("","",rndHlt);
  56. }
  57.  
  58. override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
  59. {
  60. Entity playerEnt;
  61. playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
  62. Class.CastTo(m_player, playerEnt);
  63.  
  64. GetGame().SelectPlayer(identity, m_player);
  65.  
  66. return m_player;
  67. }
  68.  
  69. override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
  70. {
  71. /*
  72. player.RemoveAllItems();
  73.  
  74. EntityAI item = player.GetInventory().CreateInInventory(topsArray.GetRandomElement());
  75. EntityAI item2 = player.GetInventory().CreateInInventory(pantsArray.GetRandomElement());
  76. EntityAI item3 = player.GetInventory().CreateInInventory(shoesArray.GetRandomElement());
  77. */
  78. EntityAI itemEnt;
  79. ItemBase itemBs;
  80.  
  81. itemEnt = player.GetInventory().CreateInInventory("Rag");
  82. itemBs = ItemBase.Cast(itemEnt);
  83. itemBs.SetQuantity(4);
  84. SetRandomHealth(itemEnt);
  85.  
  86. itemEnt = player.GetInventory().CreateInInventory("RoadFlare");
  87. itemBs = ItemBase.Cast(itemEnt);
  88. itemBs.SetQuantity(2);
  89. SetRandomHealth(itemEnt);
  90.  
  91. itemEnt = player.GetInventory().CreateInInventory("BaseballBat");
  92. itemBs = ItemBase.Cast(itemEnt);
  93. itemBs.SetQuantity(1);
  94. SetRandomHealth(itemEnt);
  95.  
  96. itemEnt = player.GetInventory().CreateInInventory("AKM");
  97. itemBs = ItemBase.Cast(itemEnt);
  98. itemBs.SetQuantity(1);
  99. SetRandomHealth(itemEnt);
  100.  
  101. }
  102. };
  103.  
  104. Mission CreateCustomMission(string path)
  105. {
  106. return new CustomMission();
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement