Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isServer) then {
- _numberofcrates = 2; // Number of crates around the map
- _spawnCenter = [21980.1,21026.1,3.70507];
- //_spawnCenter = getmarkerpos "center"; // Use this if you want the global center of the map, it's declared in mission.sqm, island specific
- _min = 1; // minimum distance from the center position (Number) in meters
- _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
- _mindist = 5; // minimum distance from the nearest object (Number) in meters, ie. spawn at least this distance away from anything within x meters..
- _water = 0; // water mode (Number) 0: cannot be in water , 1: can either be in water or not , 2: must be in water
- _shoremode = 0; // 0: does not have to be at a shore , 1: must be at a shore
- _marker = false; // Draw a green circle in which the crate will be spawned randomly
- _markersize = 100; // Radius of the marker in meters
- diag_log format['Starting terrestrialcrater.sqf'];
- for "_i" from 1 to _numberofcrates do
- {
- _pos = [_spawnCenter,_min,_max,_mindist,_water,800,_shoremode] call BIS_fnc_findSafePos; // find a random location within range
- if (_marker) then {
- _event_marker = createMarker [ format ["loot_marker_%1", _i], _pos];
- _event_marker setMarkerShape "ELLIPSE";
- _event_marker setMarkerBrush "Solid";
- _event_marker setMarkerColor "ColorBlack";
- _event_marker setMarkerAlpha 0.45;
- _event_marker setMarkerSize [(_markersize+15), (_markersize+15)]; //green circle slightly bigger , box can spawn just outside if not increased
- _pos = [_pos select 0, _pos select 1, 0];
- };
- diag_log format['Spawncrate %1 : Location %2',_i,_pos];
- _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 !
- clearMagazineCargoGlobal _box;
- clearWeaponCargoGlobal _box;
- clearItemCargoGlobal _box;
- _box setVariable ["permaLoot",true]; //stay until reset
- _box allowDamage false; // Prevent boxes to explode when spawning
- // Add items to the crate Ex. 2 + random 2 = possible 4 /// random 8 possible 1-8 items
- _box addItemCargoGlobal ["Exile_Item_InstaDoc", 5 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_Bandage", 5 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_Vishpirin", 5 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_Defibrillator", 1 + (random 10)];
- _box addItemCargoGlobal ["optic_tws", 1 + (random 10)];
- _box addItemCargoGlobal ["optic_tws_mg", 1 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_InstaDoc", 1 + (random 10)];
- _box addItemCargoGlobal ["B_IR_Grenade", 5 + (random 10)];
- _box addItemCargoGlobal ["I_IR_Grenade", 10 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_PlasticBottleFreshWater", 1 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_Energydrink", 1 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_MountainDupe", 1 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_GloriousKnakworst", 1 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_SeedAstics", 1 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_SausageGravy", 1 + (random 10)];
- _box addItemCargoGlobal ["ItemGPS", 1 + (random 10)];
- _box addItemCargoGlobal ["Exile_Item_DuctTape", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_Rope", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodDoorKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodDoorwayKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodDrawBridgeKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodFloorKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodFloorPortKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodGateKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodLog", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodPlank", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodStairsKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodSupportKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodWallHalfKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodWallKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WoodWindowKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_WorkBenchKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_Cement", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_ConcreteDoorKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_ConcreteDoorwayKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_ConcreteGateKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_ConcreteFloorKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_ConcreteFloorPortKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_ConcreteStairsKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_ConcreteSupportKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_ConcreteWallKit", 5 + (random 13)];
- _box addItemCargoGlobal ["Exile_Item_ConcreteWindowKit", 5 + (random 13)];
- _box addWeaponCargoGlobal ["launch_O_Titan_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_O_Titan_short_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_NLAW_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_RPG32_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_B_Titan_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_I_Titan_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_Titan_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_B_Titan_short_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_I_Titan_short_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_Titan_short_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["launch_RPG7_F", 1 + (random 1)];
- _box addWeaponCargoGlobal ["LMG_Zafir_F", 2 + (random 5)];
- _box addWeaponCargoGlobal ["srifle_GM6_F", 2 + (random 5)];
- _box addWeaponCargoGlobal ["MMG_01_hex_F", 3 + (random 5)];
- _box addWeaponCargoGlobal ["MMG_02_sand_F", 2 + (random 5)];
- _box addWeaponCargoGlobal ["srifle_DMR_02_sniper_F", 3 + (random 10)];
- _box addWeaponCargoGlobal ["srifle_DMR_05_tan_f", 4 + (random 10)];
- _box addMagazineCargoGlobal ["10Rnd_338_Mag", 6 + (random 12)];
- _box addMagazineCargoGlobal ["130Rnd_338_Mag", 5 + (random 11)];
- _box addMagazineCargoGlobal ["150Rnd_93x64_Mag", 6 + (random 10)];
- _box addMagazineCargoGlobal ["5Rnd_127x108_Mag", 5 + (random 12)];
- _box addMagazineCargoGlobal ["Titan_AT", 2 + (random 12)];
- _box addMagazineCargoGlobal ["Titan_AP", 2 + (random 12)];
- _box addMagazineCargoGlobal ["Titan_AA", 2 + (random 12)];
- _box addMagazineCargoGlobal ["150Rnd_762x54_Box", 6 + (random 12)];
- _box addMagazineCargoGlobal ["150Rnd_762x54_Box_Tracer", 8 + (random 12)];
- _box addMagazineCargoGlobal ["NLAW_F", 8 + (random 12)];
- _box addMagazineCargoGlobal ["RPG32_F", 2 + (random 2)];
- _box addMagazineCargoGlobal ["RPG32_HE_F", 2+ (random 2)];
- //_box addMagazineCargoGlobal ["LMG_03_F", 8 + (random 12)];
- _box addMagazineCargoGlobal ["Exile_Item_ConcreteDoorKit", 4 + (random 8)];
- _box addMagazineCargoGlobal ["Exile_Item_ConcreteDoorwayKit", 4 + (random 8)];
- _box addMagazineCargoGlobal ["Exile_Item_ConcreteGateKit", 4 + (random 8)];
- _box addMagazineCargoGlobal ["Exile_Item_ConcreteWindowKit", 4 + (random 8)];
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement