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"];
- _spawnChance = 0.45; // Percentage chance of event happening
- _markerRadius = 350; // Radius the loot can spawn and used for the marker
- _debug = false; // Puts a marker exactly were the loot spawns
- _loot_box = "GuerillaCacheBox";
- _loot_lists = [
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz","ItemSilverBar10oz"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar","ItemGoldBar"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemBriefcase100oz"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar","ItemCopperBar"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemCopperBar","ItemCopperBar"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemCopperBar","ItemCopperBar"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemCopperBar","ItemCopperBar"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemCopperBar","ItemCopperBar"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemCopperBar","ItemCopperBar"]
- ],
- [
- ["revolver_gold_EP1"],
- ["6Rnd_45ACP","6Rnd_45ACP","6Rnd_45ACP","ItemGoldBar","ItemCopperBar","ItemGoldBar10oz","ItemSilverBar10oz","ItemTinBar","ItemSilverBar","ItemGoldBar","ItemCopperBar","ItemGoldBar10oz","ItemSilverBar10oz","ItemTinBar","ItemSilverBar"]
- ]
- ];
- _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 = 5000;
- _spawnMarker = 'center';
- if (isNil "EPOCH_EVENT_RUNNING") then {
- EPOCH_EVENT_RUNNING = false;
- };
- // Check for another event running
- if (EPOCH_EVENT_RUNNING) exitWith {
- diag_log("Event already running");
- };
- // Random chance of event happening
- _spawnRoll = random 1;
- if (_spawnRoll > _spawnChance and !_debug) exitWith {};
- EPOCH_EVENT_RUNNING = true;
- // Random location
- _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
- diag_log(format["Spawning loot event at %1", _position]);
- /*
- _event_marker = createMarker [ format ["loot_event_marker_%1", _start_time], _position];
- _event_marker setMarkerShape "ELLIPSE";
- _event_marker setMarkerColor "ColorYellow";
- _event_marker setMarkerAlpha 0.5;
- _event_marker setMarkerSize [(_markerRadius + 50), (_markerRadius + 50)];
- */
- // Configurate Marker - Refresh Marker Script by *hs-s.com | waTTe - www.banditparty.de
- _markerRadius = 100;
- _markershape = "ELLIPSE";
- _markercolor = "ColorYellow";
- _missiontype = 1; //0=EPOCH_EVENT_RUNNING 1=SPECIAL_EVENT_RUNNING
- _refreshmarker = [_location,_markerRadius,_markershape,_markercolor,_missiontype] execVM "\z\addons\dayz_server\modules\refreshmarker.sqf";
- _loot_pos = [_position,0,(_markerRadius - 100),10,0,2000,0] call BIS_fnc_findSafePos;
- if (_debug) then {
- _debug_marker = createMarker [ format ["loot_event_debug_marker_%1", _start_time], _loot_pos];
- _debug_marker setMarkerShape "ICON";
- _debug_marker setMarkerType "mil_dot";
- _debug_marker setMarkerColor "ColorYellow";
- _debug_marker setMarkerAlpha 1;
- };
- diag_log(format["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
- // 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='#FFFF66' shadow='2' size='1.75'>Treasure Crate</t><br/><t align='center' color='#ffffff'>Bandits or Pirates? We found their treasure, Check your Map for the Location!</t>"];
- customRemoteMessage = ['hint', _hint];
- publicVariable "customRemoteMessage";
- */
- // Send center message to users
- [nil,nil,rTitleText,"Bandits or Pirates? We found their treasure, Check your Map for the Location!", "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;
- deleteMarker _event_marker;
- if (_debug) then {
- deleteMarker _debug_marker;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement