Advertisement
LostCoast

Untitled

Jan 7th, 2019
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.48 KB | None | 0 0
  1. if (isServer) then {
  2. _numberofcrates = 2;  //  Number of crates around the map
  3. _spawnCenter = [21980.1,21026.1,3.70507];
  4.  
  5. //_spawnCenter = getmarkerpos "center"; // Use this if you want the global center of the map, it's declared in mission.sqm, island specific
  6.  
  7. _min = 1; // minimum distance from the center position (Number) in meters
  8.  
  9. _max = 100; // maximum distance from the center position (Number) in meters// _max = 10; // Example : maximum range of spawned crates, to keep them INSIDE the sector B compound
  10.  
  11. _mindist = 5; // minimum distance from the nearest object (Number) in meters, ie. spawn at least this distance away from anything within x meters..
  12. _water = 0; // water mode (Number)    0: cannot be in water , 1: can either be in water or not , 2: must be in water
  13. _shoremode = 0; // 0: does not have to be at a shore , 1: must be at a shore
  14. _marker = false; // Draw a green circle in which the crate will be spawned randomly
  15. _markersize = 100; // Radius of the marker in meters
  16.  
  17. diag_log format['Starting terrestrialcrater.sqf'];
  18.  
  19. for "_i" from 1 to _numberofcrates do
  20.   {
  21.     _pos = [_spawnCenter,_min,_max,_mindist,_water,800,_shoremode] call BIS_fnc_findSafePos; // find a random location within range
  22.  
  23.     if (_marker) then {
  24.         _event_marker = createMarker [ format ["loot_marker_%1", _i], _pos];
  25.         _event_marker setMarkerShape "ELLIPSE";
  26.         _event_marker setMarkerBrush "Solid";
  27.         _event_marker setMarkerColor "ColorBlack";
  28.         _event_marker setMarkerAlpha 0.45;
  29.         _event_marker setMarkerSize [(_markersize+15), (_markersize+15)]; //green circle slightly bigger , box can spawn just outside if not increased      
  30.         _pos = [_pos select 0, _pos select 1, 0];
  31.     };  
  32.  
  33.     diag_log format['Spawncrate %1 : Location %2',_i,_pos];
  34.  
  35.     _box = "Box_IND_WpsSpecial_F" createvehicle _pos;  //create the crate  .. These ARE liftable with chopper like the CH-67 , but will not stay after restarts !
  36.    
  37.     clearMagazineCargoGlobal _box;
  38.     clearWeaponCargoGlobal _box;
  39.     clearItemCargoGlobal _box;
  40.     _box setVariable ["permaLoot",true]; //stay until reset
  41.     _box allowDamage false; // Prevent boxes to explode when spawning
  42.      // Add items to the crate        Ex. 2 + random 2 = possible 4   ///  random 8 possible 1-8 items
  43.     _box addItemCargoGlobal ["Exile_Item_InstaDoc", 5 + (random 10)];
  44.     _box addItemCargoGlobal ["Exile_Item_Bandage", 5 + (random 10)];
  45.     _box addItemCargoGlobal ["Exile_Item_Vishpirin", 5 + (random 10)];
  46.     _box addItemCargoGlobal ["Exile_Item_Defibrillator", 1 + (random 10)];
  47.     _box addItemCargoGlobal ["optic_tws", 1 + (random 10)];
  48.     _box addItemCargoGlobal ["optic_tws_mg", 1 + (random 10)];
  49.     _box addItemCargoGlobal ["Exile_Item_InstaDoc", 1 + (random 10)];
  50.     _box addItemCargoGlobal ["B_IR_Grenade", 5 +  (random 10)];
  51.     _box addItemCargoGlobal ["I_IR_Grenade", 10 + (random 10)];
  52.     _box addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 1 + (random 10)];
  53.     _box addItemCargoGlobal ["Exile_Item_Energydrink", 1 + (random 10)];
  54.     _box addItemCargoGlobal ["Exile_Item_MountainDupe", 1 + (random 10)];
  55.     _box addItemCargoGlobal ["Exile_Item_GloriousKnakworst", 1 + (random 10)];
  56.     _box addItemCargoGlobal ["Exile_Item_SeedAstics", 1 + (random 10)];
  57.     _box addItemCargoGlobal ["Exile_Item_SausageGravy", 1 + (random 10)];
  58.     _box addItemCargoGlobal ["ItemGPS", 1 + (random 10)];
  59.     _box addItemCargoGlobal ["Exile_Item_DuctTape", 5 + (random 13)];
  60.     _box addItemCargoGlobal ["Exile_Item_Rope", 5 + (random 13)];
  61.     _box addItemCargoGlobal ["Exile_Item_WoodDoorKit", 5 + (random 13)];
  62.     _box addItemCargoGlobal ["Exile_Item_WoodDoorwayKit", 5 + (random 13)];
  63.     _box addItemCargoGlobal ["Exile_Item_WoodDrawBridgeKit", 5 + (random 13)];
  64.     _box addItemCargoGlobal ["Exile_Item_WoodFloorKit", 5 + (random 13)];
  65.     _box addItemCargoGlobal ["Exile_Item_WoodFloorPortKit", 5 + (random 13)];
  66.     _box addItemCargoGlobal ["Exile_Item_WoodGateKit", 5 + (random 13)];
  67.     _box addItemCargoGlobal ["Exile_Item_WoodLog", 5 + (random 13)];
  68.     _box addItemCargoGlobal ["Exile_Item_WoodPlank", 5 + (random 13)];
  69.     _box addItemCargoGlobal ["Exile_Item_WoodStairsKit", 5 + (random 13)];
  70.     _box addItemCargoGlobal ["Exile_Item_WoodSupportKit", 5 + (random 13)];
  71.     _box addItemCargoGlobal ["Exile_Item_WoodWallHalfKit", 5 + (random 13)];
  72.     _box addItemCargoGlobal ["Exile_Item_WoodWallKit", 5 + (random 13)];
  73.     _box addItemCargoGlobal ["Exile_Item_WoodWindowKit", 5 + (random 13)];
  74.     _box addItemCargoGlobal ["Exile_Item_WorkBenchKit", 5 + (random 13)];
  75.     _box addItemCargoGlobal ["Exile_Item_Cement", 5 + (random 13)];
  76.     _box addItemCargoGlobal ["Exile_Item_ConcreteDoorKit", 5 + (random 13)];
  77.     _box addItemCargoGlobal ["Exile_Item_ConcreteDoorwayKit", 5 + (random 13)];
  78.     _box addItemCargoGlobal ["Exile_Item_ConcreteGateKit", 5 + (random 13)];
  79.     _box addItemCargoGlobal ["Exile_Item_ConcreteFloorKit", 5 + (random 13)];
  80.     _box addItemCargoGlobal ["Exile_Item_ConcreteFloorPortKit", 5 + (random 13)];
  81.     _box addItemCargoGlobal ["Exile_Item_ConcreteStairsKit", 5 + (random 13)];
  82.     _box addItemCargoGlobal ["Exile_Item_ConcreteSupportKit", 5 + (random 13)];
  83.     _box addItemCargoGlobal ["Exile_Item_ConcreteWallKit", 5 + (random 13)];
  84.     _box addItemCargoGlobal ["Exile_Item_ConcreteWindowKit", 5 + (random 13)];
  85.     _box addWeaponCargoGlobal ["launch_O_Titan_F", 1 + (random 1)];
  86.     _box addWeaponCargoGlobal ["launch_O_Titan_short_F", 1 + (random 1)];
  87.     _box addWeaponCargoGlobal ["launch_NLAW_F", 1 + (random 1)];
  88.     _box addWeaponCargoGlobal ["launch_RPG32_F", 1 + (random 1)];
  89.     _box addWeaponCargoGlobal ["launch_B_Titan_F", 1 + (random 1)];
  90.     _box addWeaponCargoGlobal ["launch_I_Titan_F", 1 + (random 1)];
  91.     _box addWeaponCargoGlobal ["launch_Titan_F", 1 + (random 1)];
  92.     _box addWeaponCargoGlobal ["launch_B_Titan_short_F", 1 + (random 1)];
  93.     _box addWeaponCargoGlobal ["launch_I_Titan_short_F", 1 + (random 1)];
  94.     _box addWeaponCargoGlobal ["launch_Titan_short_F", 1 + (random 1)];
  95.     _box addWeaponCargoGlobal ["launch_RPG7_F", 1 + (random 1)];
  96.     _box addWeaponCargoGlobal ["LMG_Zafir_F", 2 + (random 5)];
  97.     _box addWeaponCargoGlobal ["srifle_GM6_F", 2 + (random 5)];
  98.     _box addWeaponCargoGlobal ["MMG_01_hex_F", 3 + (random 5)];
  99.     _box addWeaponCargoGlobal ["MMG_02_sand_F", 2 + (random 5)];
  100.     _box addWeaponCargoGlobal ["srifle_DMR_02_sniper_F", 3 + (random 10)];
  101.     _box addWeaponCargoGlobal ["srifle_DMR_05_tan_f", 4 + (random 10)];
  102.     _box addMagazineCargoGlobal ["10Rnd_338_Mag", 6 + (random 12)];
  103.     _box addMagazineCargoGlobal ["130Rnd_338_Mag", 5 + (random 11)];
  104.     _box addMagazineCargoGlobal ["150Rnd_93x64_Mag", 6 + (random 10)];
  105.     _box addMagazineCargoGlobal ["5Rnd_127x108_Mag", 5 + (random 12)];
  106.     _box addMagazineCargoGlobal ["Titan_AT", 2 + (random 12)];
  107.     _box addMagazineCargoGlobal ["Titan_AP", 2 + (random 12)];
  108.     _box addMagazineCargoGlobal ["Titan_AA", 2 + (random 12)];
  109.     _box addMagazineCargoGlobal ["150Rnd_762x54_Box", 6 + (random 12)];
  110.     _box addMagazineCargoGlobal ["150Rnd_762x54_Box_Tracer", 8 + (random 12)];
  111.     _box addMagazineCargoGlobal ["NLAW_F", 8 + (random 12)];
  112.     _box addMagazineCargoGlobal ["RPG32_F", 2 + (random 2)];
  113.     _box addMagazineCargoGlobal ["RPG32_HE_F", 2+ (random 2)];
  114.     //_box addMagazineCargoGlobal ["LMG_03_F", 8 + (random 12)];
  115.     _box addMagazineCargoGlobal ["Exile_Item_ConcreteDoorKit", 4 + (random 8)];
  116.     _box addMagazineCargoGlobal ["Exile_Item_ConcreteDoorwayKit", 4 + (random 8)];
  117.     _box addMagazineCargoGlobal ["Exile_Item_ConcreteGateKit", 4 + (random 8)];
  118.     _box addMagazineCargoGlobal ["Exile_Item_ConcreteWindowKit", 4 + (random 8)];
  119.   }
  120. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement