Advertisement
Guest User

spawncrates.sqf

a guest
May 12th, 2015
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.35 KB | None | 0 0
  1. /*
  2. File: spawncrates.sqf
  3. Author: NedFox [TZW]
  4. Description: Custom Crates, randomly placed around a marker.
  5. Edit: GBR Suppe edition
  6.  
  7. Configurate the Loot in LINE 52 !
  8. */
  9. if (isServer) then {
  10.  
  11. diag_log format['***[Sector] Spawn crates***'];
  12.  
  13. // Box spawn on Coordiantes: (not aktiv)
  14. // Example : This is the center around which the crates will spawn, Sector B island on Tavi. //Coords Sector Center
  15. //_spawnCenter = [16529.719,18420.574,34.364796];
  16.  
  17. // Box spawn on Marker: (aktiv)
  18. _spawnCenter = getmarkerpos boxspawnposi;
  19. _numberofcrates = noc;
  20. _min = mini;
  21. _max = maxi;
  22. _water = watermode;
  23. _marker = marker;
  24. _markersize = markers;
  25.  
  26. _shoremode = 0; // 0: does not have to be at a shore , 1: must be at a shore
  27. _mindist = 2; // minimum distance from the nearest object (Number) in meters, ie. spawn at least this distance away from anything within x meters..
  28.  
  29. for "_i" from 1 to _numberofcrates do
  30. {
  31. _pos = [_spawnCenter,_min,_max,_mindist,_water,2000,_shoremode] call BIS_fnc_findSafePos; // find a random location within range
  32.  
  33. if (_marker) then {
  34. _event_marker = createMarker [ format ["loot_marker_%1", _i], _pos];
  35. _event_marker setMarkerShape "ELLIPSE";
  36. _event_marker setMarkerColor "ColorGreen";
  37. _event_marker setMarkerAlpha 0.75;
  38. _event_marker setMarkerSize [(_markersize+15), (_markersize+15)]; //green circle slightly bigger , box can spawn just outside if not increased
  39. _pos = [_pos,0,_markersize,0,_water,2000,_shoremode] call BIS_fnc_findSafePos; //find a random spot INSIDE the marker area
  40. _pos = [_pos select 0, _pos select 1, 0];
  41. };
  42.  
  43. diag_log format['***[Sector] Spawncrate %1 : Location %2***',_i,_pos];
  44.  
  45. _box = "CargoNet_01_box_F" createvehicle _pos; //create the crate .. These ARE liftable with chopper like the CH-67 , but will not stay after restarts !
  46.  
  47. clearMagazineCargoGlobal _box;
  48. clearWeaponCargoGlobal _box;
  49. clearItemCargoGlobal _box;
  50. _box setVariable ["permaLoot",true]; //stay until reset
  51. _box allowDamage false; // Prevent boxes to explode when spawning
  52.  
  53. /* ******************************Configuration START********************************* */
  54.  
  55. _box addWeaponCargoGlobal ["m107Tan_EPOCH", (random 1)];
  56. _box addWeaponCargoGlobal ["AKM_EPOCH", (random 1)];
  57. _box addWeaponCargoGlobal ["MultiGun", (random 1)];
  58.  
  59. _box addMagazineCargoGlobal ["5Rnd_127x108_Mag", (random 5)];
  60. _box addMagazineCargoGlobal ["30Rnd_762x39_Mag", (random 5)];
  61. _box addMagazineCargoGlobal ["SatchelCharge_Remote_Mag", (random 1)];
  62. _box addMagazineCargoGlobal ["HandGrenade", (random 3)];
  63.  
  64. _box addItemCargoGlobal ["optic_LRPS", (random 2)];
  65. _box addItemCargoGlobal ["optic_tws", (random 2)];
  66. _box addItemCargoGlobal ["NVG_EPOCH", (random 1)];
  67. _box addItemCargoGlobal ["Rangefinder", (random 1)];
  68.  
  69. _box addItemCargoGlobal ["ItemGoldBar10oz", (random 2)];
  70. _box addItemCargoGlobal ["ItemTopaz", (random 2)];
  71. _box addItemCargoGlobal ["FAK", (random 1)];
  72. _box addItemCargoGlobal ["EnergyPack", (random 6)];
  73. _box addItemCargoGlobal ["EnergyPackLg", (random 3)];
  74. _box addItemCargoGlobal ["Heal_EPOCH", (random 5)];
  75. _box addItemCargoGlobal ["Defib_EPOCH", (random 1)];
  76. _box addItemCargoGlobal ["Repair_EPOCH", (random 1)];
  77.  
  78. _box addItemCargoGlobal ["ItemLockbox", (random 6)];
  79. _box addItemCargoGlobal ["KitShelf", (random 3)];
  80. _box addItemCargoGlobal ["KitCinderWall", (random 11)];
  81. _box addItemCargoGlobal ["KitPlotPole", (random 1)];
  82. _box addItemCargoGlobal ["V_40_EPOCH", (random 1)];
  83. _box addItemCargoGlobal ["wolf_mask_epoch", (random 1)];
  84. _box addItemCargoGlobal ["pkin_mask_epoch", (random 1)];
  85.  
  86. _box addItemCargoGlobal ["ChainSaw", 1 ];
  87. _box addItemCargoGlobal ["VehicleRepairLg", 5 ];
  88. _box addItemCargoGlobal ["ItemKiloHemp", 3 ];
  89. _box addItemCargoGlobal ["SnakeCarcass_EPOCH", 3 ];
  90. _box addItemCargoGlobal ["GoatCarcass_EPOCH", 1 ];
  91. _box addItemCargoGlobal ["EpochRadio9", 1 ];
  92. _box addItemCargoGlobal ["WhiskeyNoodle", 1 ];
  93. _box addItemCargoGlobal ["ItemSodaOrangeSherbet", 1 ];
  94. _box addItemCargoGlobal ["ItemSodaPurple", 8 ];
  95.  
  96. _box addItemCargoGlobal ["ItemSodaMocha", 8 ];
  97. _box addItemCargoGlobal ["ItemSodaBurst", 4 ];
  98. _box addItemCargoGlobal ["ItemSodaRbull", 4 ];
  99. _box addItemCargoGlobal ["CinderBlocks", 30 ];
  100. _box addItemCargoGlobal ["MortarBucket", 36 ];
  101. _box addItemCargoGlobal ["ItemScraps", 13 ];
  102. _box addItemCargoGlobal ["ItemCorrugated", 39 ];
  103. _box addItemCargoGlobal ["ItemCorrugatedLg", 16 ];
  104. _box addItemCargoGlobal ["PartPlankPack", 45 ];
  105. _box addItemCargoGlobal ["WoodLog_EPOCH", 10 ];
  106.  
  107. _box addBackpackCargoGlobal ["B_Carryall_cbr", (random 3)];
  108. _box addBackpackCargoGlobal ["B_Parachute", (random 1)];
  109. _box addBackpackCargoGlobal ["B_Carryall_ocamo", (random 3)];
  110.  
  111. // EXAMPLES:
  112. // with a not random number:
  113. // _box addBackpackCargoGlobal ["B_Carryall_ocamo", 1 + (random 1)];
  114. // without random:
  115. // _box addBackpackCargoGlobal ["B_Carryall_ocamo", 1 ];
  116.  
  117. /* ****************************** Configuration END ********************************* */
  118. }
  119. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement