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", "_loot_lists", "_loot_amount", "_loot_box", "_wait_time", "_spawnRoll", "_position", "_event_marker", "_loot_pos", "_debug_marker","_loot_box", "_hint", "_loot_weapon", "_loot_mags", "_loot_backpack", "_loot_b", "_loot_w"];
- _spawnChance = 0.35; // chance of event happening
- _markerRadius = 250; // Radius the loot can spawn and used for the marker
- _debug = false; // Puts a marker exactly were the loot spawns
- _loot_box = "USBasicWeaponsBox";
- _loot_weapon = ["ItemEtool","ItemCrowbar","itemToolbox","ItemSledge"];
- _loot_mags = [
- ["ItemTentOld", "ItemWire", "CinderBlocks", "MortarBucket", "ItemPole", "ItemTankTrap"],
- ["ItemSandbag", "CinderBlocks", "MortarBucket", "ItemPole", "ItemTankTrap"],
- ["PartFueltank", "PartGlass", "PartEngine", "PartWheel", "PartGeneric", "ItemJerrycan","PartVRotor"],
- ["PartPlankPack", "PartPlywoodPack", "CinderBlocks", "MortarBucket", "CinderBlocks", "ItemPole", "ItemTankTrap"],
- ["CinderBlocks", "MortarBucket", "ItemPole", "ItemTankTrap"]
- ];
- _loot_backpack = ["DZ_Backpack_EP1","DZ_ALICE_Pack_EP1","DZ_CivilBackpack_EP1","CZ_VestPouch_EP1","DZ_GunBag_EP1","DZ_LargeGunBag_EP1"];
- _loot = _loot_mags call BIS_fnc_selectRandom;
- _loot_b = _loot_backpack call BIS_fnc_selectRandom;
- _loot_w = _loot_weapon 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) 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 "ColorGreen";
- _event_marker setMarkerAlpha 0.75;
- _event_marker setMarkerSize [(_markerRadius + 50), (_markerRadius + 50)];
- _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 "ColorBlue";
- _debug_marker setMarkerAlpha 1;
- };
- diag_log(format["Creating building supply drop at %1", _loot_pos]);
- // Information text
- [nil,nil,rTitleText,"A cargo plane dropped a box full of building supplies! Check your map to see its location!", "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;
- // Add loot
- for "_x" from 1 to _loot_amount do {
- _item = _loot call BIS_fnc_selectRandom;
- _loot_box addMagazineCargoGlobal [_item, 1];
- };
- _loot_box addBackpackCargoGlobal [_loot_b, 1];
- _loot_box addWeaponCargoGlobal [_loot_w, 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