Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // NN Custom supply side mission event mass description
- // Example taken from: http://dayzepoch.com/forum/index.php?/topic/1027-spawn-ammo-box-with-loot-sample/
- // https://dl.dropboxusercontent.com/u/135243/dayz_epoch/sample_loot_event.sqf
- // Edited with "side mission script" as example
- // Edited by Randomness
- private ["_spawnChance", "_spawnMarker", "_spawnRadius", "_markerRadius", "_item", "_debug", "_start_time", "_loot_amount", "_loot_box", "_wait_time", "_spawnRoll", "_spawnRoll0", "_spawnRoll1", "_position", "_event_marker", "_loot_pos", "_debug_marker","_loot_box", "_hint", "_loot_mags", "_loot_backpack", "_loot_brief", "_loot_b", "_loot_wt0", "_loot_wt1", "_loot_wt2", "_loot_bcs", "_gun_t0", "_gun_t1", "_gun_t2"];
- _spawnChance = 0.35; // chance of event happening
- _markerRadius = 400; // Radius the loot can spawn and used for the marker
- _debug = false; // Puts a marker exactly were the loot spawns
- _loot_box = "USBasicWeaponsBox";
- _loot_wt0 = ["M110_NVG_ep1",
- "FN_FAL_ANPVS4",
- "BAF_LRR_scoped",
- "SCAR_H_LNG_Sniper_SD",
- "SCAR_H_CQC_CCO",
- "SCAR_H_CQC_CCO_SD",
- "SCAR_L_STD_HOLO",
- "SCAR_L_CQC_CCO_SD",
- "SCAR_L_CQC_EGLM_Holo",
- "SCAR_L_STD_EGLM_RCO",
- "SCAR_L_STD_Mk4CQT"];
- _loot_wt1 = ["SVD_NSPU_EP1",
- "M4A1_AIM_SD_camo",
- "G36_C_SD_camo",
- "SVD_des_EP1",
- "M40A3",
- "SVD_CAMO",
- "Pecheneg_DZ",
- "M24_des_EP1",
- "M24",
- "VSS_vintorez",
- "M14_EP1"];
- _loot_wt2 = ["LeeEnfield",
- "Remington870_lamp",
- "M1014",
- "M249_DZ",
- "M240_DZ",
- "Mk_48_DZ",
- "M4SPR",
- "MP5SD",
- "AK_74",
- "M16A2",
- "G36A_camo",
- "G36C_camo",
- "G36C",
- "M16A2GL",
- "M16A4_ACG",
- "M4A1",
- "AK_47_M",
- "AKS_74_U",
- "AKS_74_kobra",
- "Sa58V_EP1",
- "Sa58V_CCO_EP1",
- "M4A1_Aim",
- "M4A3_CCO_EP1",
- "M4A1_HWS_GL_camo"];
- _loot_mags = ["30Rnd_556x45_Stanag",
- "30Rnd_556x45_StanagSD",
- "20Rnd_762x51_FNFAL",
- "100Rnd_762x51_M240",
- "200Rnd_556x45_M249",
- "100Rnd_762x54_PK",
- "20Rnd_762x51_DMR",
- "10Rnd_762x54_SVD",
- "30Rnd_9x19_MP5SD",
- "20Rnd_9x39_SP5_VSS",
- "20Rnd_762x51_SB_SCAR",
- "8Rnd_B_Beneli_74Slug",
- "5Rnd_762x51_M24",
- "HandGrenade_west",
- "30Rnd_545x39_AK",
- "30Rnd_762x39_AK47",
- "5Rnd_762x51_M24",
- "20Rnd_762x51_B_SCAR",
- "5Rnd_86x70_L115A1",
- "30Rnd_762x39_SA58",
- "5x_22_LR_17_HMR"];
- _loot_bcs = ["ItemBriefcaseEmpty",
- "ItemBriefcase10oz",
- "ItemBriefcase20oz",
- "ItemBriefcase30oz",
- "ItemBriefcase40oz",
- "ItemBriefcase50oz",
- "ItemBriefcase60oz",
- "ItemBriefcase70oz",
- "ItemBriefcase80oz",
- "ItemBriefcase90oz",
- "ItemBriefcase100oz"];
- _loot_backpack = ["DZ_Backpack_EP1","DZ_ALICE_Pack_EP1","DZ_CivilBackpack_EP1","CZ_VestPouch_EP1","DZ_GunBag_EP1","DZ_LargeGunBag_EP1"];
- _loot_b = _loot_backpack call BIS_fnc_selectRandom;
- _loot_brief = _loot_bcs call BIS_fnc_selectRandom;
- _loot_amount = 25;
- _wait_time = 450;
- // Dont mess with theses unless u know what yours doing
- _start_time = time;
- _spawnRadius = 4000;
- _spawnMarker = [6152.5718,7716.6011,0]; //using stary sobor as center of the map
- if (isNil "EPOCH_EVENT_RUNNING") then {
- EPOCH_EVENT_RUNNING = false;
- };
- // Check for another event running
- if (EPOCH_EVENT_RUNNING and !_debug) exitWith {
- diag_log("Event already running");
- };
- EPOCH_EVENT_RUNNING = true;
- // Random chance of event happening
- _spawnRoll = random 1;
- if (_spawnRoll > _spawnChance and !_debug) exitWith {
- diag_log("Event stopped by random chance");
- EPOCH_EVENT_RUNNING = false;
- };
- // Random location
- _position = [_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 "ColorRed";
- _event_marker setMarkerAlpha 0.5;
- _event_marker setMarkerSize [(_markerRadius + 50), (_markerRadius + 50)];
- _loot_pos = [_position,0,(_markerRadius - 100),20,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 "ColorRed";
- _debug_marker setMarkerAlpha 1;
- };
- diag_log(format["Creating military supply drop at %1", _loot_pos]);
- // Information text
- [nil,nil,rTitleText,"Armed forces were forced to flee and had to leave heir gear behind! Check your to see where it happened.", "PLAIN",10] call RE;
- //Sending the message before we actually make the crate so we know at what time to check
- // Create ammo box
- _loot_box = createVehicle [_loot_box,_loot_pos,[], 0, "NONE"];
- clearMagazineCargoGlobal _loot_box;
- clearWeaponCargoGlobal _loot_box;
- clearBackpackCargoGlobal _loot_box;
- //Randomly add or not add a tier 0 and tier 1 gun
- _spawnRoll0 = random 1;
- if (_spawnRoll0 > 0.50) then {
- _gun_t0 = _loot_wt0 call BIS_fnc_selectRandom;
- _loot_box addWeaponCargoGlobal [_gun_t0, 1];
- };
- _spawnRoll1 = random 1;
- if (_spawnRoll1 > 0.50) then {
- _gun_t1 = _loot_wt1 call BIS_fnc_selectRandom;
- _loot_box addWeaponCargoGlobal [_gun_t1, 1];
- };
- //Adding 3 random guns from t2 list:
- for "_z" from 1 to 3 do {
- _gun_t2 = _loot_wt2 call BIS_fnc_selectRandom;
- _loot_box addWeaponCargoGlobal [_gun_t2, 1];
- };
- // Adding ammo
- for "_x" from 1 to _loot_amount do {
- _item = _loot_mags call BIS_fnc_selectRandom;
- _loot_box addMagazineCargoGlobal [_item, 1];
- };
- // Adding a random briefcase and backpack
- _loot_box addMagazineCargoGlobal [_loot_brief, 1];
- _loot_box addBackpackCargoGlobal [_loot_b, 1];
- diag_log("Succesfully added loot to the box, going to bed for some time now");
- // Wait
- sleep _wait_time;
- diag_log("Time to wake up, lets delete some markers and the box");
- deleteMarker _event_marker;
- if (_debug) then {
- deleteMarker _debug_marker;
- };
- deleteVehicle _loot_box;
- EPOCH_EVENT_RUNNING = false;
- diag_log("Everything should be deleted now, or at least this event came to an end");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement