Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_spawnChance", "_spawnMarker", "_spawnRadius", "_markerRadius", "_item", "_debug", "_start_time", "_loot", "_loot_amount", "_loot_box", "_wait_time", "_spawnRoll", "_position", "_event_marker", "_loot_pos", "_debug_marker","_loot_box", "_hint", "_baserunover", "_baserunover1", "_baserunover2", "_baserunover3","_baserunover4","_baserunover5","_baserunover6","_baserunover7","_baserunover8","_baserunover9","_baserunover10","_baserunover11","_baserunover12","_baserunover13","_baserunover14","_baserunover15","_baserunover16","_baserunover17","_baserunover18"];
- _spawnChance = 0.35; // Percentage chance of event happening 0.35
- _markerRadius = 200; // Radius the loot can spawn and used for the marker
- _debug = true; // Puts a marker exactly were the loot spawns
- _loot_box = "GuerillaCacheBox";
- _loot_lists = [
- [
- ["AKS74U_DZ","Sa58V_CCO_EP1","ItemEtool","ItemCrowbar","ItemKnife","ItemSledge","ItemCompass","Binocular"],
- ["150Rnd_127x107_DSHKM","30Rnd_545x39_AK","30Rnd_556x45_G36"]
- ],
- [
- ["vil_SKS"],
- ["30Rnd_545x39_AK","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit","ItemWoodFloor","metal_floor_kit"]
- ],
- [
- ["ItemToolbox","RPK74_DZ"],
- ["75Rnd_762x39_RPK","ItemWoodFloor","ItemSodaCoke","FoodCanSardines"]
- ],
- [
- ["ChainSaw"],
- ["ItemCorrugated","ItemCorrugated","ItemPole","ItemPole","ItemPole","ItemComboLock","ItemGenerator"]
- ],
- [
- ["vil_Abakan"],
- ["30Rnd_545x39_AK","30Rnd_545x39_AK","30Rnd_545x39_AK","FoodCanFrankBeans","CinderBlocks"]
- ],
- [
- ["SVD_DZ"],
- ["10Rnd_762x54_SVD","HandGrenade_east","HandGrenade_east","FoodCanSardines","FoodMRE","CinderBlocks"]
- ]
- ];
- _loot = _loot_lists call BIS_fnc_selectRandom;
- _loot_amount = 75;
- _wait_time = 900;
- // Dont mess with theses unless u know what yours doing
- _start_time = time;
- _spawnRadius = 5200;
- _spawnMarker = 'center';
- // Random chance of event happening
- _spawnRoll = random 1;
- if (_spawnRoll > _spawnChance and !_debug) exitWith {};
- // Random location
- _position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;
- diag_log(format["MISSION EVENT ------- RUBBLE TOWN ---------- Spawning loot event at %1", _position]);
- _event_marker = createMarker [ format ["loot_event_marker_%1", _start_time], _position];
- _event_marker setMarkerShape "RECTANGLE";
- _event_marker setMarkerColor "ColorOrange";
- _event_marker setMarkerAlpha 0.5;
- _event_marker setMarkerBrush "FDiagonal";
- _event_marker setMarkerSize [_markerRadius, _markerRadius];
- //
- _event_markerLabel = createMarker [ format ["loot_event_marker_%1", _start_time], _position];
- _event_markerLabel setMarkerColor "ColorBlack";
- _event_markerLabel setMarkerText "Rubble Town";
- _positionarray = [
- [(_position select 0) - 14.5, (_position select 1) - 21,-0.012],
- [(_position select 0) - 20, (_position select 1) - 20,-0.012],
- [(_position select 0) + 25, (_position select 1) + 5,-0.012],
- [(_position select 0) + 16, (_position select 1) - 14,-0.012],
- [(_position select 0) + 49, (_position select 1) + 17.5,-0.012],
- [(_position select 0) + 38.5, (_position select 1) - 16,-0.012]
- ];
- _loot_pos = _positionarray call BIS_fnc_selectRandom;
- _vehclass = cargo_trucks call BIS_fnc_selectRandom;
- if (_debug) then {
- _debug_marker = createMarker [ format ["loot_event_debug_marker_%1", _start_time], _loot_pos];
- _debug_marker setMarkerShape "ICON";
- _debug_marker setMarkerText "Rebellious Base inoperative";
- _debug_marker setMarkerType "mil_dot";
- _debug_marker setMarkerColor "ColorOrange";
- _debug_marker setMarkerAlpha 1;
- };
- diag_log(format["MISSION EVENT ------- RUBBLE TOWN ---------- Creating ammo box at %1", _loot_pos]);
- // Create ammo box
- _loot_box = createVehicle [_loot_box,_loot_pos,[], 0, "NONE"];
- clearMagazineCargoGlobal _loot_box;
- clearWeaponCargoGlobal _loot_box;
- // Cut the grass around the loot position
- _clutter = createVehicle ["ClutterCutter_small_2_EP1", _loot_pos, [], 0, "CAN_COLLIDE"];
- _clutter setPos _loot_pos;
- // cut the grass end
- // Buildings and Objects
- _baserunover = createVehicle ["Land_a_stationhouse_ruins",[(_position select 0) - 5, (_position select 1) + 16,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover setDir 0;
- _baserunover setVectorUp surfaceNormal position _baserunover;
- _baserunover1 = createVehicle ["Land_kostel_trosky_ruins", [(_position select 0) + 1, (_position select 1) - 13,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover1 setDir 0;
- _baserunover1 setVectorUp surfaceNormal position _baserunover1;
- _baserunover2 = createVehicle ["Land_ruin_01", [(_position select 0) - 13, (_position select 1) - 3,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover2 setDir 0;
- _baserunover2 setVectorUp surfaceNormal position _baserunover2;
- _baserunover3 = createVehicle ["Land_ruin_chimney", [(_position select 0) + 14, (_position select 1) - 8,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover3 setDir 0;
- _baserunover3 setVectorUp surfaceNormal position _baserunover3;
- _baserunover4 = createVehicle ["Land_ruin_corner_2",[(_position select 0) + 17, (_position select 1) - 14,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover4 setDir 0;
- _baserunover4 setVectorUp surfaceNormal position _baserunover4;
- _baserunover5 = createVehicle ["Land_ruin_walldoor", [(_position select 0) - 12, (_position select 1) - 11,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover5 setDir 0;
- _baserunover5 setVectorUp surfaceNormal position _baserunover5;
- _baserunover6 = createVehicle ["MAP_rubble_bricks_02", [(_position select 0) + 7, (_position select 1) + 3,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover6 setDir 0;
- _baserunover6 setVectorUp surfaceNormal position _baserunover6;
- _baserunover7 = createVehicle ["MAP_rubble_wood_03", [(_position select 0) - 19, (_position select 1) - 9,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover7 setDir 0;
- _baserunover7 setVectorUp surfaceNormal position _baserunover7;
- _baserunover9 = createVehicle ["MAP_Misc_trunk_water", [(_position select 0) - 9, (_position select 1) - 14,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover9 setDir 0;
- _baserunover9 setVectorUp surfaceNormal position _baserunover9;
- _baserunover10 = createVehicle ["MAP_HouseBlock_C1_ruins", [(_position select 0) + 30, (_position select 1) + 18,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover10 setDir 0;
- _baserunover10 setVectorUp surfaceNormal position _baserunover10;
- _baserunover11 = createVehicle ["MAP_HouseBlock_A3_ruins", [(_position select 0) + 41, (_position select 1) - 17,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover11 setDir -183.96;
- _baserunover11 setVectorUp surfaceNormal position _baserunover11;
- _baserunover12 = createVehicle ["MAP_Ind_Stack_Big_ruins", [(_position select 0) - 30, (_position select 1) - 28,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover12 setDir 0;
- _baserunover12 setVectorUp surfaceNormal position _baserunover12;
- _baserunover13 = createVehicle ["MAP_dulni_bs",[(_position select 0) + 48, (_position select 1) + 20,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover13 setDir 0;
- _baserunover13 setVectorUp surfaceNormal position _baserunover13;
- _baserunover14 = createVehicle ["MAP_rubble_rocks_01", [(_position select 0) + 49, (_position select 1) + 5,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover14 setDir -123.02;
- _baserunover14 setVectorUp surfaceNormal position _baserunover14;
- _baserunover15 = createVehicle ["HMMWVWreck", [(_position select 0) + 22, (_position select 1) + 8,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover15 setDir 0;
- _baserunover15 setVectorUp surfaceNormal position _baserunover15;
- _baserunover16 = createVehicle ["UralWreck", [(_position select 0) + 27, (_position select 1) + 3,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover16 setDir 33.81;
- _baserunover16 setVectorUp surfaceNormal position _baserunover16;
- _baserunover17 = createVehicle ["UralWreck", [(_position select 0) - 44, (_position select 1) + 11,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover17 setDir 45.3;
- _baserunover17 setVectorUp surfaceNormal position _baserunover17;
- _baserunover18 = createVehicle ["UralWreck", [(_position select 0) - 10, (_position select 1) - 23,-0.12],[], 0, "CAN_COLLIDE"];
- _baserunover18 setDir 200.2;
- _baserunover18 setVectorUp surfaceNormal position _baserunover18;
- // Add loot
- {
- _loot_box addWeaponCargoGlobal [_x,1];
- } forEach (_loot select 0);
- {
- _loot_box addMagazineCargoGlobal [_x,1];
- } forEach (_loot select 1);
- // Send Top Right message to users , requires Remote message script
- _hint = parseText format["<t align='center' color='#31db3c' shadow='2' size='1.75'>NEW INCIDENT</t><br/><t align='center' color='#ffffff'>!Militars destroyed a small rebel base! Check your Map for the Location.</t>"];
- RemoteMessage = ['hint', _hint];
- publicVariable "RemoteMessage";
- // Send center message to users
- // [nil,nil,rTitleText,"Mercenaries stashed a loot crate in rubble town]", "PLAIN",10] call RE;
- diag_log(format["Loot event setup, waiting for %1 seconds", _wait_time]);
- // Wait
- sleep _wait_time;
- // Clean up
- // EPOCH_EVENT_RUNNING = false;
- deleteVehicle _loot_box;
- // delete town
- deleteVehicle _baserunover;
- deleteVehicle _baserunover1;
- deleteVehicle _baserunover2;
- deleteVehicle _baserunover3;
- deleteVehicle _baserunover4;
- deleteVehicle _baserunover5;
- deleteVehicle _baserunover6;
- deleteVehicle _baserunover7;
- deleteVehicle _baserunover9;
- deleteVehicle _baserunover10;
- deleteVehicle _baserunover11;
- deleteVehicle _baserunover12;
- deleteVehicle _baserunover13;
- deleteVehicle _baserunover14;
- deleteVehicle _baserunover15;
- deleteVehicle _baserunover16;
- deleteVehicle _baserunover17;
- deleteVehicle _baserunover18;
- deleteMarker _event_marker;
- deleteMarker _event_markerLabel;
- if (_debug) then {
- deleteMarker _debug_marker;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement