Guest User

Untitled

a guest
Nov 24th, 2015
12
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private ["_max_art","_art_chance","_min_anamalies","_max_anamalies","_kolichestvo_anamalies","_b","_rnd","_anamalyArray","_pos","_a","_kolichestvo_art","_anamaliya_name","_anamaliya","_art","_pos_art","_art_spawn"];
  2.  
  3. diag_log "[Randomnaya_Generaciya_Anamalii]: skript zagrujen";
  4.  
  5. _max_art = 3; //макс. кол-во артифактов на 1 анамалию
  6. _art_chance = 50; //шанс генерации артифакта на 1 цикл
  7. _min_anamalies = 24; //мин. кол-во анамалий 25 шт.
  8. _max_anamalies = 25; //макс. кол-во анамалий 50 шт.
  9. _kolichestvo_anamalies = floor (random _max_anamalies) + _min_anamalies; //высчитываем число анамалий основываясь на данных выше
  10. _b = 0; //начало отсчета цикла для спавна анамалий
  11. _rnd = 0; //начало отсчета для выбора анамалий
  12.  
  13. _anamalyArray = [ //конфиги анамалий
  14. [
  15. "Burn", //имя анамалии
  16. 20, //радиус спавна артифакта от анамалии
  17. [20, 20, 0, false], //зона активации тригера
  18. ["this", "XC=[thistrigger,10]execvm ""anamalies\Burn.sqf"";", ""], //условия дамага и запуска скрипта
  19. ["DAP_TEARS","DAP_FIRE"] //артифакты на анамалии
  20. ],
  21. [
  22. "Gravi",
  23. 20,
  24. [20, 20, 0, false],
  25. ["this", "XC=[thistrigger,10]execvm ""anamalies\Gravi.sqf"";", ""],
  26. ["DAP_BLACKDRIP","DAP_GRAVI","DAP_EMPTY"]
  27. ],
  28. [
  29. "Trampoline",
  30. 20,
  31. [20, 20, 0, false],
  32. ["this", "XC=[thistrigger,10]execvm ""anamalies\Trampoline.sqf"";", ""],
  33. ["DAP_BLACKDRIP","DAP_GRAVI","DAP_EMPTY"]
  34. ],
  35. [
  36. "Mincer",
  37. 20,
  38. [20, 20, 0, false],
  39. ["this", "XC=[thistrigger,10]execvm ""anamalies\Mincer.sqf"";", ""],
  40. ["DAP_STONEBLOOD","DAP_MEAT","DAP_SOUL"]
  41. ],
  42. [
  43. "Electro",
  44. 30,
  45. [30, 30, 0, false],
  46. ["this", "XC=[thistrigger,15]execvm ""anamalies\Electro.sqf"";", ""],
  47. ["DAP_ELECTRA","DAP_SPIKES","DAP_BATTERY"]
  48. ],
  49. [
  50. "Galantine",
  51. 50,
  52. [50, 50, 0, false],
  53. ["this", "XC=[thistrigger,50]execvm ""anamalies\Galantine.sqf"";", ""],
  54. ["DAP_AMEBA","DAP_CRYSTALL"]
  55. ],
  56. [
  57. "Radiation",
  58. 100,
  59. [100, 100, 0, false],
  60. ["this", "XC=[thistrigger,100]execvm ""anamalies\Radiation.sqf"";", ""],
  61. []
  62. ],
  63. [
  64. "Psy",
  65. 250,
  66. [250, 250, 0, false],
  67. ["this", "XC=[thistrigger,250]execvm ""anamalies\Psy.sqf"";", ""],
  68. []
  69. ]
  70. ];
  71.  
  72. While {_b < _kolichestvo_anamalies} do {
  73. _rnd = floor (random 7); //генерируем число для рандомной анамалию
  74. _anamalyArraySelected = (_anamalyArray select _rnd); // выбираем рандомную анамалию
  75. _b = _b + 1;
  76. {
  77. _pos = [getMarkerPos 'Center',0,dayz_MapArea,25,0,2000,0] call BIS_fnc_findSafePos; //позиция для анамалии
  78. _a = 0; //начало отсчета цикла для спавна артифактов
  79. _kolichestvo_art = floor (random _max_art); //генерация случайного количества артефактов на одной анамалии где макс кол-во - _max_art
  80. _anamaliya_name = (_x select 0); //получаем название анамалии для лога
  81.  
  82. _anamaliya = createTrigger ["EmptyDetector", _pos];
  83. _anamaliya setTriggerArea (_x select 2);
  84. _anamaliya setTriggerActivation ["ANY", "PRESENT", true];
  85. _anamaliya setTriggerStatements (_x select 3);
  86. While {_a < _kolichestvo_art} do {
  87. _a = _a + 1;
  88. if ((floor (random 100) < _art_chance)) then {
  89. _art = (_x select 4) call BIS_fnc_selectRandom; //выбор рандомного артифакта
  90. _pos_art = [_pos, 1, (_x select 1), 3, 0, 20, 0] call BIS_fnc_findSafePos; //позиция для артифакта
  91. _art_spawn = _art createVehicle _pos_art; //спавн артифакта
  92. };
  93. };
  94. diag_log format["[Randomnaya_Generaciya_Anamalii]: vsego_anamalii (%3) anamaliya (%1) coordinata (%2)",_anamaliya_name,_pos,_kolichestvo_anamalies];
  95. } forEach _anamalyArraySelected;
  96. };
  97.  
  98. diag_log "[Randomnaya_Generaciya_Anamalii]: skript vipolnen";
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×