This commit is contained in:
2022-04-21 16:15:41 +03:00
commit 9d4fc88901
601 changed files with 66252 additions and 0 deletions

View File

@ -0,0 +1,63 @@
/*
Spawns care packages.
Single parameter:
integer Number of care packages to spawn.
Author:
Foxy
*/
#include "\z\addons\dayz_code\util\Math.hpp"
#include "\z\addons\dayz_code\util\Vector.hpp"
#include "\z\addons\dayz_code\loot\Loot.hpp"
//Number of care packages to spawn
#define SPAWN_NUM 6
//Parameters for finding a suitable position to spawn the crash site
#define SEARCH_CENTER getMarkerPos "carepackages"
#define SEARCH_RADIUS (getMarkerSize "carepackages") select 0
#define SEARCH_DIST_MIN 30
#define SEARCH_SLOPE_MAX 1000
#define SEARCH_BLACKLIST [[[12923,3643],[14275,2601]]]
#define CLUTTER_CUTTER 0 //0 = loot hidden in grass, 1 = loot lifted, 2 = no grass, 3 = debug sphere.
private ["_typeGroup","_position","_type","_class","_vehicle","_lootGroup","_lootNum","_lootPos","_lootVeh","_size"];
_lootGroup = Loot_GetGroup("CarePackage");
_typeGroup = Loot_GetGroup("CarePackageType");
for "_i" from 1 to (SPAWN_NUM) do
{
_type = Loot_SelectSingle(_typeGroup);
_class = _type select 1;
_lootNum = round Math_RandomRange(_type select 2, _type select 3);
_position = [SEARCH_CENTER, 0, SEARCH_RADIUS, SEARCH_DIST_MIN, 0, SEARCH_SLOPE_MAX, 0, SEARCH_BLACKLIST] call BIS_fnc_findSafePos;
_position set [2, 0];
diag_log format ["DEBUG: Spawning a care package (%1) at %2 with %3 items.", _class, _position, _lootNum];
//_vehicle = createVehicle [_class, _position, [], 0, "CAN_COLLIDE"];
_vehicle = _class createVehicle _position;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _vehicle];
_vehicle setVariable ["ObjectID", 1, true];
_size = sizeOf _class;
{
//Calculate random loot position
_lootPos = Vector_Add(_position, Vector_Multiply(Vector_FromDir(random 360), _size * 0.6 + random _size));
_lootPos set [2, 0];
_lootVeh = Loot_Spawn(_x, _lootPos, "");
_lootVeh setVariable ["permaLoot", true];
call {
if (CLUTTER_CUTTER == 1) exitWith {_lootPos set [2, 0.05]; _lootVeh setPosATL _lootpos;};
if (CLUTTER_CUTTER == 2) exitWith {"ClutterCutter_small_2_EP1" createVehicle _lootPos;};
if (CLUTTER_CUTTER == 3) exitWith {"Sign_sphere100cm_EP1" createVehicle _lootPos;};
};
} forEach Loot_Select(_lootGroup, _lootNum);
};

View File

@ -0,0 +1,79 @@
/*
Spawns crash sites at the beginning of mission.
Author:
Foxy
Modified for DayZ Epoch Event Spawner by JasonTM
*/
#include "\z\addons\dayz_code\util\Math.hpp"
#include "\z\addons\dayz_code\util\Vector.hpp"
#include "\z\addons\dayz_code\loot\Loot.hpp"
//Chance to spawn a crash site
#define SPAWN_CHANCE 0.75
//Parameters for finding a suitable position to spawn the crash site
#define SEARCH_CENTER getMarkerPos "crashsites"
#define SEARCH_RADIUS (getMarkerSize "crashsites") select 0
#define SEARCH_DIST_MIN 20
#define SEARCH_SLOPE_MAX 2
#define SEARCH_BLACKLIST [[[2092,14167],[10558,12505]]]
//Number of crash sites to spawn
#define NUMBER 3
//Number of loot items to spawn per site
#define LOOT_MIN 5
#define LOOT_MAX 8
#define CLUTTER_CUTTER 0 //0 = loot hidden in grass, 1 = loot lifted, 2 = no grass, 3 = debug sphere.
private ["_spawnCrashSite","_type","_class","_lootGroup","_position","_vehicle","_lootParams","_dir","_mag","_lootNum","_lootPos","_lootVeh"];
_spawnCrashSite =
{
_type = Loot_SelectSingle(Loot_GetGroup("CrashSiteType"));
_class = _type select 1;
_lootGroup = Loot_GetGroup(_type select 2);
_lootNum = round Math_RandomRange(LOOT_MIN, LOOT_MAX);
_position = [SEARCH_CENTER, 0, SEARCH_RADIUS, SEARCH_DIST_MIN, 0, SEARCH_SLOPE_MAX, 0, SEARCH_BLACKLIST] call BIS_fnc_findSafePos;
_position set [2, 0];
diag_log format ["CRASHSPAWNER: Spawning crash site (%1) at %2 with %3 items.", _class, _position, _lootNum];
_vehicle = "ClutterCutter_small_2_EP1" createVehicle _position;
_vehicle = _class createVehicle [0,0,0];
_vehicle setVariable ["ObjectID", 1, true];
_vehicle setDir random 360;
_vehicle setPos _position;
_lootParams = getArray (configFile >> "CfgVehicles" >> _class >> "lootParams");
{
_dir = random 360;
_mag = random (_lootParams select 4);
_lootPos = [((_lootParams select 2) + _mag) * sin _dir, ((_lootParams select 3) + _mag) * cos _dir, 0];
_lootPos = Vector_Add(_lootPos, _lootParams select 0);
_lootPos = Vector_Rotate2D(_lootPos, _lootParams select 1);
_lootPos = _vehicle modelToWorld _lootPos;
_lootPos set [2, 0];
_lootVeh = Loot_Spawn(_x, _lootPos, "");
_lootVeh setVariable ["permaLoot", true];
call {
if (CLUTTER_CUTTER == 1) exitWith {_lootPos set [2, 0.05]; _lootVeh setPosATL _lootpos;};
if (CLUTTER_CUTTER == 2) exitWith {"ClutterCutter_small_2_EP1" createVehicle _lootPos;};
if (CLUTTER_CUTTER == 3) exitWith {"Sign_sphere100cm_EP1" createVehicle _lootPos;};
};
} forEach Loot_Select(_lootGroup, _lootNum);
};
//Spawn crash sites
for "_i" from 1 to (NUMBER) do
{
call _spawnCrashSite;
};

View File

@ -0,0 +1,91 @@
/*
Spawns infected camps
Author:
Foxy
*/
#include "\z\addons\dayz_code\util\Math.hpp"
#include "\z\addons\dayz_code\loot\Loot.hpp"
//Number of infected camps to spawn
#define CAMP_NUM 3
//Minimum distance between camps
#define CAMP_MIN_DIST 300
//Base class of objects to add loot to
#define CAMP_CONTAINER_BASE "IC_Tent"
//Loot per tent
#define LOOT_MIN 10
#define LOOT_MAX 20
//Random objects per camp
#define OBJECT_MIN 4
#define OBJECT_MAX 12
//Radius around the camp in which random objects are spawned
#define OBJECT_RADIUS_MIN 8
#define OBJECT_RADIUS_MAX 13
#define SEARCH_CENTER getMarkerPos "center"
#define SEARCH_RADIUS (getMarkerSize "center") select 0
#define SEARCH_EXPRESSION "(5 * forest) + (4 * trees) + (3 * meadow) - (20 * houses) - (30 * sea)" //+ (3 * meadow) - (20 * houses) - (30 * sea)
#define SEARCH_PRECISION 30
#define SEARCH_ATTEMPTS 10
private
[
"_typeGroup",
"_lootGroup",
"_objectGroup",
"_type",
"_position",
"_composition",
"_compositionObjects",
"_objectPos"
];
_typeGroup = Loot_GetGroup("InfectedCampType");
_lootGroup = Loot_GetGroup("InfectedCamp");
_objectGroup = Loot_GetGroup("InfectedCampObject");
for "_i" from 1 to (CAMP_NUM) do
{
//Select type of camp
_type = Loot_SelectSingle(_typeGroup);
_composition = _type select 1;
//Find a position
for "_j" from 1 to (SEARCH_ATTEMPTS) do
{
_position = ((selectBestPlaces [SEARCH_CENTER, SEARCH_RADIUS, SEARCH_EXPRESSION, SEARCH_PRECISION, 1]) select 0) select 0;
_position set [2, 0];
//Check if a camp already exists within the minimum distance
if (count (_position nearObjects [CAMP_CONTAINER_BASE,CAMP_MIN_DIST]) < 1) exitWith {};
};
diag_log format ["DEBUG: Spawning an infected camp (%1) at %2", _composition, _position];
//Spawn composition
_compositionObjects = [_position, random 360,_composition] call spawnComposition;
//Add loot to containers
{
if (_x isKindOf (CAMP_CONTAINER_BASE)) then
{
Loot_InsertCargo(_x, _lootGroup, round Math_RandomRange(LOOT_MIN, LOOT_MAX));
};
} forEach _compositionObjects;
//Spawn objects around the camp
{
_objectPos = [_position, OBJECT_RADIUS_MIN, OBJECT_RADIUS_MAX, 5] call fn_selectRandomLocation;
Loot_Spawn(_x, _objectPos, "");
} forEach Loot_Select(_objectGroup, round Math_RandomRange(OBJECT_MIN, OBJECT_MAX));
};

View File

@ -0,0 +1,116 @@
/*
Abandoned player safe mission by Cramps (zfclan.org/forum)
Updated for DayZ Epoch 1.0.6+ by JasonTM
Updated for DayZ Epoch 1.0.7+ by JasonTM
Instructions at the bottom of the file.
Needs an SQL event set up to turn abandoned vault codes to 0000 - bottom of file.
Last update: 06-01-2021
*/
local _spawnChance = 1; // Percentage chance of event happening.The number must be between 0 and 1. 1 = 100% chance.
local _debug = false; // Posts additional diagnostic entries to the rpt
local _toGround = false; // If the safe is more than 2 meters above the ground, this will find a near spot on the ground to move the safe.
local _radius = 150; // Radius used for the marker width
local _type = "TitleText"; // Type of announcement message. Options "Hint","TitleText".
local _timeout = 20; // Time it takes for the event to time out (in minutes).
#define TITLE_COLOR "#669900" // Hint Option: Color of Top Line
#define TITLE_SIZE "1.75" // Hint Option: Size of top line
#define IMAGE_SIZE "4" // Hint Option: Size of the image
if (random 1 > _spawnChance && !_debug) exitWith {};
diag_log "Abandoned Safe Event Starting...";
if ((count DZE_LockedSafes) < 1) exitWith {diag_log "There are no safes on the map.";};
local _vaults = [];
local _current = 0;
local _code = 0;
for "_i" from 0 to (count DZE_LockedSafes)-1 do {
_current = DZE_LockedSafes select _i;
_code = _current getVariable ["CharacterID", "0"];
if (_code == "0000") then {
_vaults set [count _vaults, _current];
};
};
if (count _vaults == 0) exitWith {diag_log "There are no abandoned safes on the map";};
if (_debug) then {diag_log format["Total abandoned safes on server = %1",count _vaults];};
if (_type == "Hint") then {
local _img = (getText (configFile >> "CfgMagazines" >> "ItemVault" >> "picture"));
RemoteMessage = ["hintWithImage",["STR_CL_ESE_VAULT_TITLE","STR_CL_ESE_VAULT"],[_img,TITLE_COLOR,TITLE_SIZE,IMAGE_SIZE]];
} else {
RemoteMessage = ["titleText","STR_CL_ESE_VAULT"];
};
publicVariable "RemoteMessage";
if (_debug) then {diag_log format["Abandoned Vault event setup, waiting for %1 minutes", _timeout];};
local _vault = _vaults call BIS_fnc_selectRandom;
local _pos = [_vault] call FNC_GetPos;
local _markers = [];
if (_toGround) then {
if ((_pos select 2) > 2) then {
_pos = _pos findEmptyPosition[0,100];
_pos set [2, 0];
_vault setPos _pos;
_vault setVariable ["OEMPos",_pos,true];
};
};
if (_debug) then {diag_log format["Location of randomly picked 0000 vault = %1",_pos];};
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_pos, format ["safemark_%1", diag_tickTime], "ColorKhaki", "","ELLIPSE", "", [_radius,_radius], [], 0]];
_markers set [1, [_pos, format ["safedot_%1", diag_tickTime], "ColorBlack", "mil_dot","ICON", "", [], ["STR_CL_ESE_VAULT_TITLE"], 0]];
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
uiSleep (_timeout*60);
// Tell all clients to remove the markers from the map
local _remove = [];
{
_remove set [count _remove, (_x select 1)];
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, -1];
diag_log "Abandoned Safe Event Ended";
/*
****Special Instructions****
Open server_monitor.sqf
Find this line:
dayz_serverIDMonitor = [];
Place this line below it:
DZE_LockedSafes = [];
Find this line:
_isTrapItem = _object isKindOf "TrapItems";
Place this line above it:
if (_type in ["VaultStorageLocked","VaultStorage2Locked","TallSafeLocked"]) then {DZE_LockedSafes set [count DZE_LockedSafes, _object];};
****Run this query on your database to reset the code of inactive safes to 0000.****
DROP EVENT IF EXISTS resetVaults; CREATE EVENT resetVaults
ON SCHEDULE EVERY 1 DAY
COMMENT 'Sets safe codes to 0000 if not accessed for 14 days'
DO
UPDATE `object_data` SET `CharacterID` = 0
WHERE
`LastUpdated` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND
`Datestamp` < DATE_SUB(CURRENT_TIMESTAMP, INTERVAL 14 DAY) AND
`CharacterID` > 0 AND
`Classname` IN ('VaultStorageLocked','VaultStorage2Locked','TallSafeLocked') AND
`Inventory` <> '[]' AND
`Inventory` IS NOT NULL
*/

View File

@ -0,0 +1,136 @@
/*
Original Construction "IKEA" Event by Aidem
Original "crate visited" marker concept and code by Payden
Rewritten and updated for DayZ Epoch 1.0.6+ by JasonTM
Updated for DayZ Epoch 1.0.7+ by JasonTM
Last update: 06-01-2021
*/
local _spawnChance = 1; // Percentage chance of event happening.The number must be between 0 and 1. 1 = 100% chance.
local _chainsawChance = .25; // Chance that a chainsaw with mixed gas will be added to the crate. The number must be between 0 and 1. 1 = 100% chance.
local _vaultChance = .25; // Chance that a safe or lockbox will be added to the crate. The number must be between 0 and 1. 1 = 100% chance.
local _radius = 350; // Radius the loot can spawn and used for the marker.
local _timeout = 20; // Time it takes for the event to time out (in minutes). To disable timeout set to -1.
local _debug = false; // Diagnostic logs used for troubleshooting.
local _nameMarker = true; // Center marker with the name of the mission.
local _markPos = false; // Puts a marker exactly were the loot spawns.
local _lootAmount = 15; // This is the number of times a random loot selection is made.
local _type = "TitleText"; // Type of announcement message. Options "Hint","TitleText". ***Warning: Hint appears in the same screen space as common debug monitors
local _visitMark = true; // Places a "visited" check mark on the mission if a player gets within range of the crate.
local _distance = 20; // Distance in meters from crate before crate is considered "visited"
local _crate = "DZ_AmmoBoxBigUS"; // Class name of loot crate.
#define TITLE_COLOR "#00FF11" // Hint Option: Color of Top Line
#define TITLE_SIZE "1.75" // Hint Option: Size of top line
#define IMAGE_SIZE "4" // Hint Option: Size of the image
local _lootList = [ // If the item has a number in front of it, then that many will be added to the crate if it is selected one time. Each item can be selected multiple times. Adjust the array configuration to your preferences.
[3,"MortarBucket"],"ItemWoodStairs",[12,"CinderBlocks"],"plot_pole_kit",[12,"PartPlankPack"],[12,"PartPlywoodPack"],"m240_nest_kit","light_pole_kit","ItemWoodCrateKit","ItemFuelBarrel",
[4,"metal_floor_kit"],[4,"ItemWoodFloor"],[4,"half_cinder_wall_kit"],[4,"metal_panel_kit"],"fuel_pump_kit",[4,"full_cinder_wall_kit"],"ItemWoodWallWithDoorLgLocked","storage_shed_kit","sun_shade_kit","wooden_shed_kit",
[2,"ItemComboLock"],[4,"ItemWoodWallLg"],"ItemWoodWallGarageDoorLocked",[4,"ItemWoodWallWindowLg"],"wood_ramp_kit",[8,"ItemWoodFloorQuarter"],"bulk_ItemSandbag","bulk_ItemTankTrap","bulk_ItemWire","bulk_PartGeneric",
"workbench_kit","cinder_garage_kit","cinder_door_kit","wood_shack_kit","deer_stand_kit",[3,"ItemWoodWallThird"],"ItemWoodLadder",[3,"desert_net_kit"],[3,"forest_net_kit"],[2,"ItemSandbagLarge"]
];
if (random 1 > _spawnChance and !_debug) exitWith {};
local _pos = [getMarkerPos "center",0,(((getMarkerSize "center") select 1)*0.75),10,0,.3,0] call BIS_fnc_findSafePos;
diag_log format["IKEA Event spawning at %1", _pos];
local _lootPos = [_pos,0,(_radius - 100),10,0,2000,0] call BIS_fnc_findSafePos;
if (_debug) then {diag_log format["IKEA Event: creating ammo box at %1", _lootPos];};
local _box = _crate createVehicle [0,0,0];
_box setPos _lootPos;
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;
if (random 1 < _vaultChance) then {
local _vault = ["ItemVault","ItemLockbox"] call BIS_fnc_selectRandom;
_box addMagazineCargoGlobal [_vault,1];
};
if (random 1 < _chainsawChance) then {
local _saw = ["Chainsaw","ChainSawB","ChainsawG","ChainsawP"] call BIS_fnc_selectRandom;
_box addMagazineCargoGlobal ["ItemJerryMixed",2];
_box addWeaponCargoGlobal [_saw,1];
};
for "_i" from 1 to _lootAmount do {
local _loot = _lootList call BIS_fnc_selectRandom;
if ((typeName _loot) == "ARRAY") then {
_box addMagazineCargoGlobal [_loot select 1,_loot select 0];
} else {
_box addMagazineCargoGlobal [_loot,1];
};
};
local _pack = ["Patrol_Pack_DZE1","Assault_Pack_DZE1","Czech_Vest_Pouch_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","LargeGunBag_DZE1"] call BIS_fnc_selectRandom;
_box addBackpackCargoGlobal [_pack,1];
if (_type == "Hint") then {
local _img = (getText (configFile >> "CfgVehicles" >> "UralCivil_DZE" >> "picture"));
RemoteMessage = ["hintWithImage",["STR_CL_ESE_IKEA_TITLE","STR_CL_ESE_IKEA"],[_img,TITLE_COLOR,TITLE_SIZE,IMAGE_SIZE]];
} else {
RemoteMessage = ["titleText","STR_CL_ESE_IKEA"];
};
publicVariable "RemoteMessage";
if (_debug) then {diag_log format["IKEA Event setup, event will end in %1 minutes", _timeout];};
local _time = diag_tickTime;
local _done = false;
local _visited = false;
local _isNear = true;
local _markers = [1,1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_pos, format ["eventMark%1", _time], "ColorGreen", "","ELLIPSE", "", [_radius, _radius], [], 0.5]];
if (_nameMarker) then {_markers set [1, [_pos, format ["eventDot%1",_time], "ColorBlack", "mil_dot","ICON", "", [], ["STR_CL_ESE_IKEA_TITLE"], 0]];};
if (_markPos) then {_markers set [2, [_lootPos, format ["eventDebug%1",_time], "ColorGreen", "mil_dot","ICON", "", [], [], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
while {!_done} do {
uiSleep 3;
if (_visitMark && !_visited) then {
{
if (isPlayer _x && {_x distance _box <= _distance}) exitWith {
_visited = true;
_markers set [3, [[(_pos select 0), (_pos select 1) + 25], format ["EventVisit%1", _time], "ColorBlack", "hd_pickup","ICON", "", [], [], 0]];
DZE_ServerMarkerArray set [_markerIndex, _markers];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 3)];
publicVariable "PVDZ_ServerMarkerSend";
};
} count playableUnits;
};
if (_timeout != -1) then {
if (diag_tickTime - _time >= _timeout*60) then {
_done = true;
};
};
};
while {_isNear} do {
uiSleep 3;
{if (isPlayer _x && _x distance _box >= _distance) exitWith {_isNear = false};} count playableUnits;
};
// Clean up
deleteVehicle _box;
// Tell all clients to remove the markers from the map
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, -1];
diag_log "IKEA Event Ended";

View File

@ -0,0 +1,4 @@
// Sample Drop Bomb
private ["_position"];
_position = [getMarkerPos "center",0,((getMarkerSize "center") select 1),10,0,2000,0] call BIS_fnc_findSafePos;
bomb = createVehicle ["Bo_GBU12_LGB", [(_position select 0),(_position select 1), 1000], [], 0, "CAN_COLLIDE"];

View File

@ -0,0 +1,220 @@
/*
Fuel Station Bombing event by JasonTM
Credit to juandayz for original "Random Explosions on Gas Stations" event.
Updated to work with DayZ Epoch 1.0.7
Last edited 6-1-2021
***As of now, this event only has gas station positions for Chernarus.
*/
local _timeout = 20; // Time it takes for the event to time out (in minutes). To disable timeout set to -1.
local _delay = 2; // This is the time in minutes it will take for the explosion to occur after announcement
local _lowerGrass = true; // remove grass underneath loot so it is easier to find small objects
local _visitMark = true; // Places a "visited" check mark on the mission if a player gets within range of the vehicle.
local _distance = 20; // Distance from vehicle before event is considered "visited"
local _nameMarker = true; // Center marker with the name of the mission.
local _type = "Hint"; // Type of announcement message. Options "Hint","TitleText". ***Warning: Hint appears in the same screen space as common debug monitors
#define TITLE_COLOR "#ff9933" // Hint Option: Color of Top Line
#define TITLE_SIZE "1.75" // Hint Option: Size of top line
// You can adjust these loot selections to your liking. Must be magazine/item slot class name, not weapon or tool belt.
// Nested arrays are number of each item and item class name.
/*
local _lootArrays = [
[[6,"full_cinder_wall_kit"],[1,"cinder_door_kit"],[1,"cinder_garage_kit"],[4,"forest_large_net_kit"]],
[[6,"metal_floor_kit"],[6,"ItemWoodFloor"],[2,"ItemWoodStairs"],[10,"ItemSandbag"]],
[[24,"CinderBlocks"],[8,"MortarBucket"]]
];
*/
// Vehicle Upgrade kits
local _lootArrays = [
/*Truck*/ [["ItemTruckORP",1],["ItemTruckAVE",1],["ItemTruckLRK",1],["ItemTruckTNK",1],["PartEngine",2],["PartWheel",6],["ItemScrews",8],["PartGeneric",10],["equip_metal_sheet",5],["ItemWoodCrateKit",2],["PartFueltank",3],["ItemGunRackKit",2],["ItemFuelBarrel",2]],
/*Vehicle*/ [["ItemORP",1],["ItemAVE",1],["ItemLRK",1],["ItemTNK",1],["PartEngine",2],["PartWheel",4],["ItemScrews",8],["equip_metal_sheet",6],["PartGeneric",8],["ItemWoodCrateKit",2],["ItemGunRackKit",2],["PartFueltank",2],["ItemFuelBarrel",1]],
/*Helicopter*/ [["ItemHeliAVE",1],["ItemHeliLRK",1],["ItemHeliTNK",1],["equip_metal_sheet",5],["ItemScrews",2],["ItemTinBar",3],["equip_scrapelectronics",5],["equip_floppywire",5],["PartGeneric",4],["ItemWoodCrateKit",1],["ItemGunRackKit",1],["ItemFuelBarrel",1]],
/*Tank-APC*/ [["ItemTankORP",1],["ItemTankAVE",1],["ItemTankLRK",1],["ItemTankTNK",1],["PartEngine",6],["PartGeneric",6],["ItemScrews",6],["equip_metal_sheet",8],["ItemWoodCrateKit",2],["ItemGunRackKit",2],["PartFueltank",6],["ItemFuelBarrel",4]]
];
// Select random loot array from above
local _loot = _lootArrays call BIS_fnc_selectRandom;
// Initialize locations array
if (isNil "FuelStationEventArray") then {
FuelStationEventArray = [
// Vehicle direction, vehicle position, fuel station name
[96.8,[3640.58,8979.26,0],"Vybor"],
[58.3,[6708.22,2986.89,0],"Cherno"],
[10,[5849.21,10085.1,0],"Grishino"],
[130,[7243.35,7644.83,0],"Novy Sobor"],
[29,[10163.4,5304.94,0],"Staroye"],
[94.6,[9497.25,2016,0],"Elektro"],
[347,[13394.8,6605.09,0],"Solnechiy"],
[200,[2034.43,2242.05,0],"Kamenka"],
[8.5,[2681.41,5604.03,0],"Zelenogorsk"],
[87,[4734.43,6373.43,0],"Pogorevka"],
[329.3,[10456.5,8868.75,0],"Gorka"],
[10.5,[12998.1,10074.4,0],"Berezino"]
];
};
// Don't spawn the event at a fuel station where a player is refueling/repairing a vehicle
local _validSpot = false;
local _random = [];
local _pos = [0,0,0];
while {!_validSpot} do {
_random = FuelStationEventArray call BIS_fnc_selectRandom;
_pos = _random select 1;
{if (isPlayer _x && _x distance _pos >= 100) then {_validSpot = true};} count playableUnits; // players are at least 100 meters away.
};
local _dir = _random select 0;
local _name = _random select 2;
{ // Remove current location from array so there are no repeats
if (_name == (_x select 2)) exitWith {
FuelStationEventArray = [FuelStationEventArray,_forEachIndex] call fnc_deleteAt;
};
} forEach FuelStationEventArray;
// If all locations have been removed, reset to original array by destroying global variable
if (count FuelStationEventArray == 0) then {FuelStationEventArray = nil;};
if (_type == "Hint") then {
RemoteMessage = ["hintNoImage",["STR_CL_ESE_FUELBOMB_TITLE",["STR_CL_ESE_FUELBOMB_START", _name, _delay]],[TITLE_COLOR,TITLE_SIZE]];
} else {
RemoteMessage = ["titleText",["STR_CL_ESE_FUELBOMB_START", _name, _delay]];
};
publicVariable "RemoteMessage";
// Spawn truck
local _truck = "Ural_CDF" createVehicle _pos;
_truck setDir _dir;
_truck setPos _pos;
_truck setVehicleLock "locked";
_truck setVariable ["CharacterID","9999",true];
// Disable damage to near fuel pumps so the explosion doesn't destroy them.
// Otherwise players will complain about not being able to refuel and repair their vehicles.
{
_x allowDamage false;
} count (_pos nearObjects ["Land_A_FuelStation_Feed", 30]);
local _time = diag_tickTime;
local _done = false;
local _visited = false;
local _isNear = true;
local _spawned = false;
local _lootArray = [];
local _grassArray = [];
local _lootRad = 0;
local _lootPos = [0,0,0];
local _lootVeh = objNull;
local _lootArray = [];
local _grass = objNull;
local _grassArray = [];
local _markers = [1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_pos, "fuel" + str _time, "ColorRed", "","ELLIPSE", "", [150,150], [], 0.4]];
if (_nameMarker) then {_markers set [1, [_pos, "explosion" + str _time, "ColorBlack", "mil_dot","ICON", "", [], ["STR_CL_ESE_FUELBOMB_TITLE"], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
// Start monitoring loop
while {!_done} do {
uiSleep 3;
if (_visitMark && !_visited) then {
{
if (isPlayer _x && {_x distance _pos <= _distance}) exitWith {
_visited = true;
_markers set [2, [[(_pos select 0), (_pos select 1) + 25], "fuelVmarker" + str _time, "ColorBlack", "hd_pickup","ICON", "", [], [], 0]];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 2)];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
} count playableUnits;
};
if (!_spawned && {diag_tickTime - _time >= _delay*60}) then {
if (_type == "Hint") then {
RemoteMessage = ["hintNoImage",["STR_CL_ESE_FUELBOMB_TITLE",["STR_CL_ESE_FUELBOMB_END",_name]],[TITLE_COLOR,TITLE_SIZE]];
} else {
RemoteMessage = ["titleText",["STR_CL_ESE_FUELBOMB_END",_name]];
};
publicVariable "RemoteMessage";
// Blow the vehicle up
"Bo_GBU12_LGB" createVehicle _pos;
uiSleep 2;
/*
// Spawn loot around the destroyed vehicle
{
for "_i" from 1 to (_x select 0) do {
_lootRad = (random 10) + 4;
_lootPos = [_pos, _lootRad, random 360] call BIS_fnc_relPos;
_lootPos set [2, 0];
_lootVeh = createVehicle ["WeaponHolder", _lootPos, [], 0, "CAN_COLLIDE"];
_lootVeh setVariable ["permaLoot", true];
_lootVeh addMagazineCargoGlobal [(_x select 1), 1];
_lootArray set[count _lootArray, _lootVeh];
if (_lowerGrass) then {
_grass = createVehicle ["ClutterCutter_small_2_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
_grassArray set[count _grassArray, _grass];
};
};
} count _loot;
*/
// Spawn loot around the destroyed vehicle
{
for "_i" from 1 to (_x select 1) do {
_lootRad = (random 10) + 4;
_lootPos = [_pos, _lootRad, random 360] call BIS_fnc_relPos;
_lootPos set [2, 0];
_lootVeh = createVehicle ["WeaponHolder", _lootPos, [], 0, "CAN_COLLIDE"];
_lootVeh setVariable ["permaLoot", true];
_lootVeh addMagazineCargoGlobal [(_x select 0), 1];
_lootArray set[count _lootArray, _lootVeh];
if (_lowerGrass) then {
_grass = createVehicle ["ClutterCutter_small_2_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
_grassArray set[count _grassArray, _grass];
};
};
} count _loot;
// Reset the timer once loot is spawned
_time = diag_tickTime;
_spawned = true;
};
// Timeout timer starts after loot is spawned
if (_spawned && {_timeout != -1}) then {
if (diag_tickTime - _time >= _timeout*60) then {
_done = true;
};
};
};
// If player is near, don't delete the loot piles
while {_isNear} do {
{if (isPlayer _x && _x distance _pos >= 30) exitWith {_isNear = false};} count playableUnits;
};
// Tell all clients to remove the markers from the map
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, -1];
// Delete loot piles and grass cutters
{deleteVehicle _x;} count _lootArray;
if (count _grassArray > 0) then {{deleteVehicle _x;} count _grassArray;};

View File

@ -0,0 +1,193 @@
/*
Original Labyrinth Event by Caveman
Rewritten and updated for DayZ Epoch 1.0.6+ by JasonTM
Updated for DayZ Epoch 1.0.7+ by JasonTM
Last update: 06-01-2021
*/
local _spawnChance = 1; // Percentage chance of event happening.The number must be between 0 and 1. 1 = 100% chance.
local _numGems = [0,1]; // Random number of gems to add to the crate [minimum, maximum]. For no gems, set to [0,0].
local _radius = 250; // Radius the loot can spawn and used for the marker
local _timeout = 20; // Time it takes for the event to time out (in minutes). To disable timeout set to -1.
local _debug = false; // Diagnostic logs used for troubleshooting.
local _nameMarker = true; // Center marker with the name of the mission.
local _markPos = false; // Puts a marker exactly where the loot spawns.
local _lootAmount = 4; // This is the number of times a random loot selection is made.
local _messageType = "TitleText"; // Type of announcement message. Options "Hint","TitleText". ***Warning: Hint appears in the same screen space as common debug monitors
local _visitMark = false; // Places a "visited" check mark on the mission if a player gets within range of the crate.
local _distance = 20; // Distance from crate before crate is considered "visited"
local _crate = "GuerillaCacheBox";
#define TITLE_COLOR "#ccff33" // Hint Option: Color of Top Line
#define TITLE_SIZE "1.75" // Hint Option: Size of top line
#define IMAGE_SIZE "4" // Hint Option: Size of the image
local _lootList = [[5,"ItemGoldBar"],[3,"ItemGoldBar10oz"],"ItemBriefcase100oz",[20,"ItemSilverBar"],[10,"ItemSilverBar10oz"]];
if (random 1 > _spawnChance and !_debug) exitWith {};
local _pos = [getMarkerPos "center",0,(((getMarkerSize "center") select 1)*0.75),10,0,.3,0] call BIS_fnc_findSafePos;
diag_log format["Labyrinth Event Spawning At %1", _pos];
local _posarray = [
[(_pos select 0) + 9, (_pos select 1) + 2.3,-0.012],
[(_pos select 0) - 18.6, (_pos select 1) + 15.6,-0.012],
[(_pos select 0) - 8.5, (_pos select 1) - 21,-0.012],
[(_pos select 0) - 33, (_pos select 1) - 6,-0.012],
[(_pos select 0) + 5, (_pos select 1) - 44,-0.012],
[(_pos select 0) - 23, (_pos select 1) - 20,-0.012],
[(_pos select 0) + 13, (_pos select 1) - 23,-0.012],
[(_pos select 0) + 7, (_pos select 1) - 6,-0.012],
[(_pos select 0) - 5, (_pos select 1) + 1,-0.012],
[(_pos select 0) - 42, (_pos select 1) - 6,-0.012],
[(_pos select 0) - 4.3, (_pos select 1) - 39,-0.012]
];
local _spawnObjects = {
local _pos = _this select 1;
local _objArray = [];
local _obj = objNull;
{
local _offset = _x select 1;
local _position = [(_pos select 0) + (_offset select 0), (_pos select 1) + (_offset select 1), 0];
local _obj = (_x select 0) createVehicle [0,0,0];
if (count _x > 2) then {
_obj setDir (_x select 2);
};
_obj setPos _position;
_obj setVectorUp surfaceNormal position _obj;
_obj addEventHandler ["HandleDamage",{0}];
_obj enableSimulation false;
_objArray set [count _objArray, _obj];
} count (_this select 0);
_objArray
};
local _lootPos = _posarray call BIS_fnc_selectRandom;
if (_debug) then {diag_log format["Labyrinth Event: creating ammo box at %1", _lootPos];};
local _box = _crate createVehicle [0,0,0];
_box setPos _lootPos;
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;
local _clutter = createVehicle ["ClutterCutter_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
_clutter setPos _lootPos;
local _objects = [[
["Land_MBG_Shoothouse_1",[-35,-6.5,-0.12]],
["Land_MBG_Shoothouse_1",[-12,9,-0.12]],
["Land_MBG_Shoothouse_1",[-16,-19.3,-0.12]],
["Land_MBG_Shoothouse_1",[7,-15,-0.12]],
["Land_MBG_Shoothouse_1",[3,-39.5,-0.12]],
["Land_A_Castle_Bergfrit",[9.5,3,-10.52]],
["Land_A_Castle_Donjon_dam",[4,17,-1.93]],
["Land_A_Castle_Wall1_20",[-11.6,21.7,-7.28]],
["Land_A_Castle_Wall1_20",[-35.4,6.4,-7.28]],
["Land_A_Castle_Donjon",[16,-10.3,-1.93]],
["Sign_arrow_down_large_EP1",[15,-35,0.52]],
["Sign_arrow_down_large_EP1",[-8.6,-51,0.52]],
["Sign_arrow_down_large_EP1",[-27,-30.5,0.52]],
["Sign_arrow_down_large_EP1",[-46,-17.4,0.52]],
["Sign_arrow_down_large_EP1",[-22.7,7.7,0.52]],
["MAP_t_acer2s",[-8,-31,-0.12]],
["MAP_t_acer2s",[-46.5,-15,-0.12],91.4],
["MAP_t_acer2s",[-23,10,-0.12],89.09],
["MAP_t_acer2s",[-27.3,-28,-0.12],90.6],
["MAP_t_acer2s",[14,-32,-0.12],-88.1],
["MAP_t_acer2s",[-8.5,-48,-0.12],86.08]
],_pos] call _spawnObjects;
local _gems = (round(random((_numGems select 1) - (_numGems select 0)))) + (_numGems select 0);
if (_debug) then {diag_log format["Labyrinth Event: %1 gems added to crate", _gems];};
if (_gems > 0) then {
for "_i" from 1 to _gems do {
local _gem = ["ItemTopaz","ItemObsidian","ItemSapphire","ItemAmethyst","ItemEmerald","ItemCitrine","ItemRuby"] call BIS_fnc_selectRandom;
_box addMagazineCargoGlobal [_gem,1];
};
};
for "_i" from 1 to _lootAmount do {
local _loot = _lootList call BIS_fnc_selectRandom;
if ((typeName _loot) == "ARRAY") then {
_box addMagazineCargoGlobal [_loot select 1,_loot select 0];
} else {
_box addMagazineCargoGlobal [_loot,1];
};
};
local _pack = ["Patrol_Pack_DZE1","Assault_Pack_DZE1","Czech_Vest_Pouch_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","LargeGunBag_DZE1"] call BIS_fnc_selectRandom;
_box addBackpackCargoGlobal [_pack,1];
if (_messageType == "Hint") then {
local _img = (getText (configFile >> "CfgVehicles" >> "Land_MBG_Shoothouse_1" >> "icon"));
RemoteMessage = ["hintWithImage",["STR_CL_ESE_LABYRINTH_TITLE","STR_CL_ESE_LABYRINTH"],[_img,TITLE_COLOR,TITLE_SIZE,IMAGE_SIZE]];
} else {
RemoteMessage = ["titleText","STR_CL_ESE_LABYRINTH"];
};
publicVariable "RemoteMessage";
if (_debug) then {diag_log format["Labyrinth event setup, waiting for %1 minutes", _timeout];};
local _time = diag_tickTime;
local _finished = false;
local _visited = false;
local _isNear = true;
local _markers = [1,1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_pos, format ["eventMark%1", _time], "ColorYellow", "","ELLIPSE", "", [_radius, _radius], [], 0.5]];
if (_nameMarker) then {_markers set [1, [_pos, format ["eventDot%1",_time], "ColorBlack", "mil_dot","ICON", "", [], ["STR_CL_ESE_LABYRINTH_TITLE"], 0]];};
if (_markPos) then {_markers set [2, [_lootPos, format ["eventDebug%1",_time], "ColorYellow", "mil_dot","ICON", "", [], [], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
while {!_finished} do {
uiSleep 3;
if (_visitMark && !_visited) then {
{
if (isPlayer _x && {_x distance _box <= _distance}) exitWith {
_visited = true;
_markers set [3, [[(_pos select 0), (_pos select 1) + 25], format ["EventVisit%1", _time], "ColorBlack", "hd_pickup","ICON", "", [], [], 0]];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 3)];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
} count playableUnits;
};
if (_timeout != -1) then {
if (diag_tickTime - _time >= _timeout*60) then {
_finished = true;
};
};
};
while {_isNear} do {
{if (isPlayer _x && _x distance _box >= _distance) exitWith {_isNear = false};} count playableUnits;
};
// Tell all clients to remove the markers from the map
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, -1];
{
deleteVehicle _x;
} count _objects;
deleteVehicle _box;
deleteVehicle _clutter;
diag_log "Labyrinth Event Ended";

View File

@ -0,0 +1,200 @@
/*
Mechanic's Truck event by JasonTM
This event spawns a truck filled with vehicle upgrade parts inside a building of type "Land_Hangar_2"
7-8-2021
*/
local _timeout = 20; // Time it takes for the event to time out (in minutes). To disable timeout set to -1.
local _key = true; // Issue a key for the truck. The key will be in the gear.
local _visitMark = true; // Places a "visited" check mark on the mission if a player gets within range of the vehicle.
local _numpacks = 2; // Be mindful of how many backpacks cargo trucks can hold.
local _distance = 20; // Distance from vehicle before event is considered "visited"
local _nameMarker = true; // Center marker with the name of the mission.
local _type = "Hint"; // Type of announcement message. Options "Hint","TitleText". ***Warning: Hint appears in the same screen space as common debug monitors
#define TITLE_COLOR "#ff9933" // Hint Option: Color of Top Line
#define TITLE_SIZE "1.75" // Hint Option: Size of top line
#define DEBUG false
// Get a list of all of the vehicle hangars on the map
local _list = (getMarkerPos "center") nearObjects ["Land_Hangar_2", 15000];
if (count _list == 0) exitWith {diag_log "Mechanic's Truck Event: No Land_Hangar_2 on the map.";};
local _garage = objNull;
local _pos = [];
local _i = 1;
local _success = false;
while {_i < 50} do {
_garage = _list call BIS_fnc_selectRandom;
_pos = getPosATL _garage;
local _nearPlayer = false;
{
if (_x distance _pos < 50) exitWith {
_nearPlayer = true;
};
} count playableUnits;
// Check for near vehicles, players and plots
if (count (_pos nearObjects ["LandVehicle", 20]) == 0 && !_nearPlayer && {count (_pos nearEntities ["Plastic_Pole_EP1_DZ", 100]) == 0}) exitWith {
_success = true;
};
_i = _i + 1;
};
if (!_success) exitWith {diag_log "Mechanic's Truck Event: No suitable locations found.";};
local _near = nearestLocations [_pos, ["NameCityCapital","NameCity","NameVillage","NameLocal"],1000];
local _loc = "Unknown Location";
if (count _near > 0) then {
_loc = text (_near select 0);
};
diag_log format["Mechanic's Truck Event spawning near %1, at %2", _loc, _pos];
// Vehicle Upgrade kits - these include all parts to fully upgrade a DZE vehicle.
local _kit = [
[["ItemTruckORP",1],["ItemTruckAVE",1],["ItemTruckLRK",1],["ItemTruckTNK",1],["PartEngine",2],["PartWheel",6],["ItemScrews",8],["PartGeneric",10],["equip_metal_sheet",5],["ItemWoodCrateKit",2],["PartFueltank",3],["ItemGunRackKit",2],["ItemFuelBarrel",2]],
[["ItemORP",1],["ItemAVE",1],["ItemLRK",1],["ItemTNK",1],["PartEngine",2],["PartWheel",4],["ItemScrews",8],["equip_metal_sheet",6],["PartGeneric",8],["ItemWoodCrateKit",2],["ItemGunRackKit",2],["PartFueltank",2],["ItemFuelBarrel",1]],
[["ItemHeliAVE",1],["ItemHeliLRK",1],["ItemHeliTNK",1],["equip_metal_sheet",5],["ItemScrews",2],["ItemTinBar",3],["equip_scrapelectronics",5],["equip_floppywire",5],["PartGeneric",4],["ItemWoodCrateKit",1],["ItemGunRackKit",1],["PartFueltank",2],["ItemFuelBarrel",1]],
[["ItemTankORP",1],["ItemTankAVE",1],["ItemTankLRK",1],["ItemTankTNK",1],["PartEngine",6],["PartGeneric",6],["ItemScrews",6],["equip_metal_sheet",8],["ItemWoodCrateKit",2],["ItemGunRackKit",2],["PartFueltank",6],["ItemFuelBarrel",4]]
] call BIS_fnc_selectRandom;
// Tools needed to upgrade vehicles.
local _tools = ["ItemToolbox","ItemCrowbar","ItemSolder_DZE"];
if (_type == "Hint") then {
RemoteMessage = ["hintNoImage",["STR_CL_ESE_MECHANIC_TITLE",["STR_CL_ESE_MECHANIC_START",_loc]],[TITLE_COLOR,TITLE_SIZE]];
} else {
RemoteMessage = ["titleText",["STR_CL_ESE_MECHANIC_START",_loc]];
};
publicVariable "RemoteMessage";
// Spawn truck
local _class = ["Ural_INS_DZE","Ural_CDF_DZE","UralOpen_CDF_DZE","Ural_TK_CIV_EP1_DZE","Ural_UN_EP1_DZE","UralCivil_DZE","UralCivil2_DZE","UralSupply_TK_EP1_DZE","UralReammo_CDF_DZE","UralReammo_INS_DZE","UralRepair_CDF_DZE","UralRepair_INS_DZE","V3S_Open_TK_CIV_EP1_DZE","V3S_Open_TK_EP1_DZE","V3S_Civ_DZE","V3S_TK_EP1_DZE","V3S_Camper_DZE","V3S_RA_TK_GUE_EP1_DZE","Kamaz_DZE","KamazOpen_DZE","KamazRepair_DZE","KamazReammo_DZE","MTVR_DES_EP1_DZE","MTVR_DZE","MTVR_Open_DZE","MtvrRepair_DZE","MtvrReammo_DZE","T810A_ACR_DZE","T810A_ACR_DES_DZE","T810A_ACR_OPEN_DZE","T810A_ACR_DES_OPEN_DZE","T810_ACR_REAMMO_DZE","T810_ACR_REAMMO_DES_DZE","T810_ACR_REPAIR_DZE","T810_ACR_REPAIR_DES_DZE"] call BIS_fnc_selectRandom;
local _truck = _class createVehicle _pos;
_truck setDir (getDir _garage - 180); // Turn truck around to face the door.
_truck setPosATL (_garage modelToWorld [8.56738,2.10254,-2.55316]);
_truck setVariable ["ObjectID","1", true];
_truck setVariable ["CharacterID","0",true];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _truck];
clearWeaponCargoGlobal _truck;
clearMagazineCargoGlobal _truck;
_truck setVariable["Cleanup" + dayz_serverKey, true];
// Assign the hitpoints
{
local _selection = getText(configFile >> "cfgVehicles" >> _class >> "HitPoints" >> _x >> "name");
local _strH = "hit_" + (_selection);
_truck setHit[_selection,0];
_truck setVariable [_strH,0,true];
} count (_truck call vehicle_getHitpoints);
// Add key to the gear of the truck
if (_key) then {
local _keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;
local _keyNumber = (floor(random 2500)) + 1;
local _keySelected = format["ItemKey%1%2",_keyColor,_keyNumber];
local _isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
local _characterID = str(getNumber(configFile >> "CfgWeapons" >> _keySelected >> "keyid"));
if (_isKeyOK) then {
_truck addWeaponCargoGlobal [_keySelected,1];
_truck setVariable ["CharacterID",_characterID,true];
} else {
diag_log format ["Mechanic's Vehicle Event: There was a problem generating a key for the %1", _truck];
};
};
// Add the loot
{
_truck addMagazineCargoGlobal [(_x select 0), (_x select 1)];
} count _kit;
{
_truck addWeaponCargoGlobal [_x, 1];
} count _tools;
for "_i" from 1 to _numpacks do {
local _pack = ["CzechBackpack_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","LargeGunBag_DZE1"] call BIS_fnc_selectRandom;
_truck addBackpackCargoGlobal [_pack,1];
};
// Add the publishing event handler
_truck addEventHandler ["GetIn", {
local _truck = _this select 0;
RemoteMessage = ["rollingMessages","STR_CL_DZMS_VEH1"];
(owner (_this select 2)) publicVariableClient "RemoteMessage";
local _class = typeOf _truck;
local _worldspace = [getDir _truck, getPosATL _truck];
_truck setVariable["Cleanup" + dayz_serverKey, false];
local _uid = _worldspace call dayz_objectUID2;
format ["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:", dayZ_instance, _class, 0, (_truck getVariable ["CharacterID", "0"]), _worldspace, [getWeaponCargo _truck,getMagazineCargo _truck,getBackpackCargo _truck], [], 1, _uid] call server_hiveWrite;
local _result = (format["CHILD:388:%1:", _uid]) call server_hiveReadWrite;
if ((_result select 0) != "PASS") then {
deleteVehicle _truck;
diag_log format ["Mechanic's Vehicle Event PublishVeh Error: failed to get id for %1 : UID %2.",_class, _uid];
} else {
_truck setVariable ["ObjectID", (_result select 1), true];
_truck setVariable ["lastUpdate",diag_tickTime];
_truck call fnc_veh_ResetEH;
PVDZE_veh_Init = _truck;
publicVariable "PVDZE_veh_Init";
if (DEBUG) then {diag_log ("Mechanic's Vehicle Event PublishVeh: Created " + (_class) + " with ID " + str(_uid));};
};
}];
local _time = diag_tickTime;
local _done = false;
local _visited = false;
local _isNear = true;
local _markers = [1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_pos, "MechanicsVeh" + str _time, "ColorBrown", "","ELLIPSE", "", [150,150], [], 0.7]];
if (_nameMarker) then {_markers set [1, [_pos, "MechanicsVehDot" + str _time, "ColorBlack", "mil_dot","ICON", "", [], ["STR_CL_ESE_MECHANIC_TITLE"], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
while {!_done} do {
uiSleep 3;
if (_visitMark && !_visited) then {
{
if (isPlayer _x && {_x distance _pos <= _distance}) exitWith {
_visited = true;
_markers set [2, [[(_pos select 0), (_pos select 1) + 25], "MechanicsVehVmarker" + str _time, "ColorBlack", "hd_pickup","ICON", "", [], [], 0]];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 2)];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
} count playableUnits;
};
if (_timeout != -1) then {
if (diag_tickTime - _time >= _timeout * 60) then {
_done = true;
};
};
};
// If player is near, don't delete the truck.
while {_isNear} do {
{if (isPlayer _x && _x distance _pos >= 30) exitWith {_isNear = false;};} count playableUnits;
};
// Tell all clients to remove the markers from the map.
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
// Delete the truck if it has not been claimed.
if (_truck getVariable ("Cleanup" + dayz_serverKey)) then {deleteVehicle _truck;};
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, -1];

View File

@ -0,0 +1,139 @@
/*
Original Treasure Event by Aidem
Original "crate visited" marker concept and code by Payden
Rewritten and updated for DayZ Epoch 1.0.6+ by JasonTM
Updated for DayZ Epoch 1.0.7+ by JasonTM
Last update: 06-01-2021
*/
local _spawnChance = 1; // Percentage chance of event happening.The number must be between 0 and 1. 1 = 100% chance.
local _gemChance = .25; // Chance that a gem will be added to the crate. The number must be between 0 and 1. 1 = 100% chance.
local _radius = 350; // Radius the loot can spawn and used for the marker
local _timeout = 20; // Time it takes for the event to time out (in minutes). To disable timeout set to -1.
local _debug = false; // Diagnostic logs used for troubleshooting.
local _nameMarker = false; // Center marker with the name of the mission.
local _markPos = false; // Puts a marker exactly were the loot spawns.
local _lootAmount = 4; // This is the number of times a random loot selection is made.
local _weapons = 3; // The number of gold and silver guns to include in the crate.
local _type = "TitleText"; // Type of announcement message. Options "Hint","TitleText". ***Warning: Hint appears in the same screen space as common debug monitors
local _visitMark = false; // Places a "visited" check mark on the mission if a player gets within range of the crate.
local _distance = 20; // Distance from crate before crate is considered "visited"
local _crate = "GuerillaCacheBox";
#define TITLE_COLOR "#FFFF66" // Hint Option: Color of Top Line
#define TITLE_SIZE "1.75" // Hint Option: Size of top line
#define IMAGE_SIZE "4" // Hint Option: Size of the image
local _lootList = [[5,"ItemGoldBar"],[3,"ItemGoldBar10oz"],"ItemBriefcase100oz",[20,"ItemSilverBar"],[10,"ItemSilverBar10oz"]];
local _weaponList = ["AKS_Gold_DZ","AKS_Silver_DZ","SVD_Gold_DZ","Revolver_Gold_DZ","Colt_Anaconda_Gold_DZ","DesertEagle_Gold_DZ","DesertEagle_Silver_DZ"];
if (random 1 > _spawnChance and !_debug) exitWith {};
local _pos = [getMarkerPos "center",0,(((getMarkerSize "center") select 1)*0.75),10,0,.3,0] call BIS_fnc_findSafePos;
diag_log format["Pirate Treasure Event Spawning At %1", _pos];
local _lootPos = [_pos,0,(_radius - 100),10,0,2000,0] call BIS_fnc_findSafePos;
if (_debug) then {diag_log format["Pirate Treasure Event: creating ammo box at %1", _lootPos];};
local _box = _crate createVehicle [0,0,0];
_box setPos _lootPos;
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;
local _cutGrass = createVehicle ["ClutterCutter_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
_cutGrass setPos _lootPos;
if (random 1 < _gemChance) then {
local _gem = ["ItemTopaz","ItemObsidian","ItemSapphire","ItemAmethyst","ItemEmerald","ItemCitrine","ItemRuby"] call BIS_fnc_selectRandom;
_box addMagazineCargoGlobal [_gem,1];
};
for "_i" from 1 to _lootAmount do {
local _loot = _lootList call BIS_fnc_selectRandom;
if ((typeName _loot) == "ARRAY") then {
_box addMagazineCargoGlobal [_loot select 1,_loot select 0];
} else {
_box addMagazineCargoGlobal [_loot,1];
};
};
for "_i" from 1 to _weapons do {
local _wep = _weaponList call BIS_fnc_selectRandom;
_box addWeaponCargoGlobal [_wep,1];
local _ammoArray = getArray (configFile >> "CfgWeapons" >> _wep >> "magazines");
if (count _ammoArray > 0) then {
local _mag = _ammoArray select 0;
_box addMagazineCargoGlobal [_mag, (3 + floor(random 3))];
};
};
local _pack = ["Patrol_Pack_DZE1","Assault_Pack_DZE1","Czech_Vest_Pouch_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","LargeGunBag_DZE1"] call BIS_fnc_selectRandom;
_box addBackpackCargoGlobal [_pack,1];
if (_type == "Hint") then {
local _img = (getText (configFile >> "CfgMagazines" >> "ItemRuby" >> "picture"));
RemoteMessage = ["hintWithImage",["STR_CL_ESE_TREASURE_TITLE","STR_CL_ESE_TREASURE"],[_img,TITLE_COLOR,TITLE_SIZE,IMAGE_SIZE]];
} else {
RemoteMessage = ["titleText","STR_CL_ESE_TREASURE"];
};
publicVariable "RemoteMessage";
if (_debug) then {diag_log format["Pirate Treasure event setup, waiting for %1 minutes", _timeout];};
local _time = diag_tickTime;
local _done = false;
local _visited = false;
local _isNear = true;
local _markers = [1,1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_pos, format ["eventMark%1", _time], "ColorYellow", "","ELLIPSE", "", [_radius, _radius], [], 0.5]];
if (_nameMarker) then {_markers set [1, [_pos, format ["eventDot%1",_time], "ColorBlack", "mil_dot","ICON", "", [], ["STR_CL_ESE_TREASURE_TITLE"], 0]];};
if (_markPos) then {_markers set [2, [_lootPos, format ["eventDebug%1",_time], "ColorYellow", "mil_dot","ICON", "", [], [], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
while {!_done} do {
uiSleep 3;
if (_visitMark && !_visited) then {
{
if (isPlayer _x && {_x distance _box <= _distance}) exitWith {
_visited = true;
_markers set [3, [[(_pos select 0), (_pos select 1) + 25], format ["EventVisit%1", _time], "ColorBlack", "hd_pickup","ICON", "", [], [], 0]];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 3)];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
} count playableUnits;
};
if (_timeout != -1) then {
if (diag_tickTime - _time >= _timeout*60) then {
_done = true;
};
};
};
while {_isNear} do {
{if (isPlayer _x && _x distance _box >= _distance) exitWith {_isNear = false};} count playableUnits;
};
// Tell all clients to remove the markers from the map
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, -1];
deleteVehicle _box;
deleteVehicle _cutGrass;
diag_log "Pirate Treasure Event Ended";

View File

@ -0,0 +1,212 @@
/*
Original Rubble Town Event by Caveman
Rewritten and updated for DayZ Epoch 1.0.6+ by JasonTM
Updated for DayZ Epoch 1.0.7+ by JasonTM
Last update: 06-01-2021
*/
local _spawnChance = 1; // Percentage chance of event happening.The number must be between 0 and 1. 1 = 100% chance.
local _chainsawChance = .5; // Chance that a chainsaw with mixed gas will be added to the crate. The number must be between 0 and 1. 1 = 100% chance.
local _radius = 200; // Radius the loot can spawn and used for the marker
local _timeout = 20; // Time it takes for the event to time out (in minutes). To disable timeout set to -1.
local _debug = false; // Diagnostic logs used for troubleshooting.
local _nameMarker = true; // Center marker with the name of the mission.
local _markPos = false; // Puts a marker exactly where the loot spawns.
local _lootAmount = 30; // This is the number of times a random loot selection is made.
local _wepAmount = 4; // This is the number of times a random weapon selection is made.
local _messageType = "TitleText"; // Type of announcement message. Options "Hint","TitleText". ***Warning: Hint appears in the same screen space as common debug monitors
local _visitMark = false; // Places a "visited" check mark on the mission if a player gets within range of the crate.
local _visitDistance = 20; // Distance from crate before crate is considered "visited"
local _crate = "GuerillaCacheBox";
#define TITLE_COLOR "#ff9933" // Hint Option: Color of Top Line
#define TITLE_SIZE "1.75" // Hint Option: Size of top line
local _bloodbag = ["bloodBagONEG","ItemBloodbag"] select dayz_classicBloodBagSystem;
local _lootList = [
_bloodbag,"ItemBandage","ItemAntibiotic","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemAntibacterialWipe","ItemHeatPack","ItemKiloHemp", // meds
"Skin_Camo1_DZ","Skin_CZ_Soldier_Sniper_EP1_DZ","Skin_CZ_Special_Forces_GL_DES_EP1_DZ","Skin_Drake_Light_DZ","Skin_FR_OHara_DZ","Skin_FR_Rodriguez_DZ","Skin_Graves_Light_DZ","Skin_Sniper1_DZ","Skin_Soldier1_DZ","Skin_Soldier_Bodyguard_AA12_PMC_DZ", // skins
"ItemSodaSmasht","ItemSodaClays","ItemSodaR4z0r","ItemSodaPepsi","ItemSodaCoke","FoodCanBakedBeans","FoodCanPasta","FoodCanSardines","FoodMRE","ItemWaterBottleBoiled","ItemSodaRbull","FoodBeefCooked","FoodMuttonCooked","FoodChickenCooked","FoodRabbitCooked","FoodBaconCooked","FoodGoatCooked","FoodDogCooked","FishCookedTrout","FishCookedSeaBass","FishCookedTuna", // food
"PartFueltank","PartWheel","PartEngine","PartGlass","PartGeneric","PartVRotor","ItemJerrycan","ItemFuelBarrel","equip_hose", // vehicle parts
"ItemDesertTent","ItemDomeTent","ItemTent"// tents
];
local _weapons = ["M16A2_DZ","M4A1_DZ","M4A1_SD_DZ","SA58_RIS_DZ","L85A2_DZ","L85A2_SD_DZ","AKM_DZ","G36C_DZ","G36C_SD_DZ","G36A_Camo_DZ","G36K_Camo_DZ","G36K_Camo_SD_DZ","CTAR21_DZ","ACR_WDL_DZ","ACR_WDL_SD_DZ","ACR_BL_DZ","ACR_BL_SD_DZ","ACR_DES_DZ","ACR_DES_SD_DZ","ACR_SNOW_DZ","ACR_SNOW_SD_DZ","AK74_DZ","AK74_SD_DZ","AK107_DZ","CZ805_A1_DZ","CZ805_A1_GL_DZ","CZ805_A2_DZ","CZ805_A2_SD_DZ","CZ805_B_GL_DZ","Famas_DZ","Famas_SD_DZ","G3_DZ","HK53A3_DZ","HK416_DZ","HK416_SD_DZ","HK417_DZ","HK417_SD_DZ","HK417C_DZ","M1A_SC16_BL_DZ","M1A_SC16_TAN_DZ","M1A_SC2_BL_DZ","Masada_DZ","Masada_SD_DZ","Masada_BL_DZ","Masada_BL_SD_DZ","MK14_DZ","MK14_SD_DZ","MK16_DZ","MK16_CCO_SD_DZ","MK16_BL_CCO_DZ","MK16_BL_Holo_SD_DZ","MK17_DZ","MK17_CCO_SD_DZ","MK17_ACOG_SD_DZ","MK17_BL_Holo_DZ","MK17_BL_GL_ACOG_DZ","MR43_DZ","PDR_DZ","RK95_DZ","RK95_SD_DZ","SCAR_H_AK_DZ","SteyrAug_A3_Green_DZ","SteyrAug_A3_Black_DZ","SteyrAug_A3_Blue_DZ","XM8_DZ","XM8_DES_DZ","XM8_GREY_DZ","XM8_GREY_2_DZ","XM8_GL_DZ","XM8_DES_GL_DZ","XM8_GREY_GL_DZ","XM8_Compact_DZ","XM8_DES_Compact_DZ","XM8_GREY_Compact_DZ","XM8_GREY_2_Compact_DZ","XM8_SD_DZ"];
if (random 1 > _spawnChance and !_debug) exitWith {};
local _pos = [getMarkerPos "center",0,(((getMarkerSize "center") select 1)*0.75),10,0,.3,0] call BIS_fnc_findSafePos;
diag_log format["Rubble Town Event Spawning At %1", _pos];
local _posarray = [
[(_pos select 0) - 39.8, (_pos select 1) + 11],
[(_pos select 0) - 47.7, (_pos select 1) + 37.8],
[(_pos select 0) - 24.3, (_pos select 1) + 38.2],
[(_pos select 0) - 6.6, (_pos select 1) + 42.7],
[(_pos select 0) - 16.5, (_pos select 1) - 6.5],
[(_pos select 0) - 56.8, (_pos select 1) + 30.3],
[(_pos select 0) - 23.3, (_pos select 1) + 22.5],
[(_pos select 0) + 1, (_pos select 1) + 20.7],
[(_pos select 0) - 21.7, (_pos select 1) + 6.7],
[(_pos select 0) - 8.7, (_pos select 1) + 29.6],
[(_pos select 0) + 9.3, (_pos select 1) + 9.4]
];
local _spawnObjects = {
local _pos = _this select 1;
local _objArray = [];
local _obj = objNull;
{
local _offset = _x select 1;
local _position = [(_pos select 0) + (_offset select 0), (_pos select 1) + (_offset select 1), 0];
local _obj = (_x select 0) createVehicle [0,0,0];
if (count _x > 2) then {
_obj setDir (_x select 2);
};
_obj setPos _position;
_obj setVectorUp surfaceNormal position _obj;
_obj addEventHandler ["HandleDamage",{0}];
_obj enableSimulation false;
_objArray set [count _objArray, _obj];
} count (_this select 0);
_objArray
};
local _lootPos = _posarray call BIS_fnc_selectRandom;
if (_debug) then {diag_log format["Rubble Town Event: creating ammo box at %1", _lootPos];};
local _box = _crate createVehicle [0,0,0];
_box setPos _lootPos;
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;
local _clutter = createVehicle ["ClutterCutter_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
_clutter setPos _lootPos;
local _objects = [[
["MAP_HouseBlock_B2_ruins",[0,0]],
["MAP_rubble_rocks_01",[-37,-5.8]],
["MAP_HouseBlock_A1_1_ruins",[-52,13]],
["MAP_rubble_bricks_02",[-22.5,-7.2]],
["MAP_rubble_bricks_03",[-22.8,2.8]],
["MAP_rubble_bricks_04",[-32.7,27.6]],
["MAP_HouseV_2L_ruins",[-21.3,14.6]],
["MAP_HouseBlock_B3_ruins",[-12.8,-15.7]],
["MAP_A_MunicipalOffice_ruins",[26,-1.6]],
["MAP_HouseBlock_A2_ruins",[-67.3,36.3]],
["MAP_Ind_Stack_Big_ruins",[15,43.3]],
["MAP_Nasypka_ruins",[-24,26.7]],
["MAP_R_HouseV_2L",[-8.2,22.7]],
["MAP_ruin_01",[.6,41.5]],
["MAP_ruin_01",[-36.7,35.7]],
["HMMWVWreck",[-14.4,-7.3]],
["T72Wreck",[6,-9.7]],
["UralWreck",[-31.3,36.6],-19.75],
["UralWreck",[-37,11]],
["UralWreck",[3.7,20.4],35.5],
["UH60_ARMY_Wreck_DZ",[-21.7,38.3]]
],_pos] call _spawnObjects;
if (random 1 < _chainsawChance) then {
local _saw = ["ChainSaw","ChainSawB","ChainSawG","ChainSawP","ChainSawR"] call BIS_fnc_selectRandom;
_box addWeaponCargoGlobal [_saw,1];
_box addMagazineCargoGlobal ["ItemJerryMixed",2];
};
for "_i" from 1 to _lootAmount do {
local _loot = _lootList call BIS_fnc_selectRandom;
_box addMagazineCargoGlobal [_loot,1];
};
for "_i" from 1 to _wepAmount do {
local _weapon = _weapons call BIS_fnc_selectRandom;
_box addWeaponCargoGlobal [_weapon,1];
local _ammoArray = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
if (count _ammoArray > 0) then {
local _mag = _ammoArray select 0;
_box addMagazineCargoGlobal [_mag, (3 + round(random 2))];
};
local _cfg = configFile >> "CfgWeapons" >> _weapon >> "Attachments";
if (isClass _cfg && {count _cfg > 0}) then {
local _attach = configName (_cfg call BIS_fnc_selectRandom);
if !(_attach == "Attachment_Tws") then { // no thermals in regular game
_box addMagazineCargoGlobal [_attach,1];
};
};
};
local _pack = ["Patrol_Pack_DZE1","Assault_Pack_DZE1","Czech_Vest_Pouch_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","LargeGunBag_DZE1"] call BIS_fnc_selectRandom;
_box addBackpackCargoGlobal [_pack,1];
if (_messageType == "Hint") then {
RemoteMessage = ["hintNoImage",["STR_CL_ESE_RUBBLETOWN_TITLE","STR_CL_ESE_RUBBLETOWN"],[TITLE_COLOR,TITLE_SIZE]];
} else {
RemoteMessage = ["titleText","STR_CL_ESE_RUBBLETOWN"];
};
publicVariable "RemoteMessage";
if (_debug) then {diag_log format["Rubble Town Event setup, waiting for %1 minutes", _timeout];};
local _time = diag_tickTime;
local _finished = false;
local _visited = false;
local _isNear = true;
local _markers = [1,1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_pos, format ["eventMark%1", _time], "ColorOrange", "","ELLIPSE", "", [(_radius + 50), (_radius + 50)], [], 0.5]];
if (_nameMarker) then {_markers set [1, [_pos, format ["eventDot%1",_time], "ColorBlack", "mil_dot","ICON", "", [], ["STR_CL_ESE_RUBBLETOWN_TITLE"], 0]];};
if (_markPos) then {_markers set [2, [_lootPos, format ["eventDebug%1",_time], "ColorOrange", "mil_dot","ICON", "", [], [], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
while {!_finished} do {
uiSleep 3;
if (_visitMark && !_visited) then {
{
if (isPlayer _x && {_x distance _box <= _distance}) exitWith {
_visited = true;
_markers set [3, [[(_pos select 0), (_pos select 1) + 25], format ["EventVisit%1", _time], "ColorBlack", "hd_pickup","ICON", "", [], [], 0]];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 3)];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
} count playableUnits;
};
if (_timeout != -1) then {
if (diag_tickTime - _time >= _timeout*60) then {
_finished = true;
};
};
};
while {_isNear} do {
{if (isPlayer _x && _x distance _box >= _visitDistance) exitWith {_isNear = false};} count playableUnits;
};
deleteVehicle _box;
deleteVehicle _clutter;
// Tell all clients to remove the markers from the map
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, -1];
{
deleteVehicle _x;
} count _objects;
diag_log "Rubble Town Event Ended";

View File

@ -0,0 +1,139 @@
/*
Original Military "Special Forces" Event by Aidem
Original "crate visited" marker concept and code by Payden
Rewritten and updated for DayZ Epoch 1.0.6+ by JasonTM
Updated for DayZ Epoch 1.0.7+ by JasonTM
Last update: 06-01-2021
*/
local _spawnChance = 1; // Percentage chance of event happening.The number must be between 0 and 1. 1 = 100% chance.
local _sniperChance = .25; // Chance that an as50, KSVK, m107, or Anzio 20 will be added to the crate. The number must be between 0 and 1. 1 = 100% chance.
local _radius = 350; // Radius the loot can spawn and used for the marker
local _timeout = 2; // Time it takes for the event to time out (in minutes). To disable timeout set to -1.
local _debug = false; // Diagnostic logs used for troubleshooting.
local _nameMarker = false; // Center marker with the name of the mission.
local _markPos = false; // Puts a marker exactly were the loot spawns.
local _lootAmount = 10; // This is the number of times a random loot selection is made.
local _type = "TitleText"; // Type of announcement message. Options "Hint","TitleText". ***Warning: Hint appears in the same screen space as common debug monitors
local _visitMark = false; // Places a "visited" check mark on the mission if a player gets within range of the crate.
local _distance = 20; // Distance from crate before crate is considered "visited"
local _crate = "DZ_AmmoBoxBigUS";
local _weapons = ["M16A2_DZ","M4A1_DZ","M4A1_SD_DZ","SA58_RIS_DZ","L85A2_DZ","L85A2_SD_DZ","AKM_DZ","G36C_DZ","G36C_SD_DZ","G36A_Camo_DZ","G36K_Camo_DZ","G36K_Camo_SD_DZ","CTAR21_DZ","ACR_WDL_DZ","ACR_WDL_SD_DZ","ACR_BL_DZ","ACR_BL_SD_DZ","ACR_DES_DZ","ACR_DES_SD_DZ","ACR_SNOW_DZ","ACR_SNOW_SD_DZ","AK74_DZ","AK74_SD_DZ","AK107_DZ","CZ805_A1_DZ","CZ805_A1_GL_DZ","CZ805_A2_DZ","CZ805_A2_SD_DZ","CZ805_B_GL_DZ","Famas_DZ","Famas_SD_DZ","G3_DZ","HK53A3_DZ","HK416_DZ","HK416_SD_DZ","HK417_DZ","HK417_SD_DZ","HK417C_DZ","M1A_SC16_BL_DZ","M1A_SC16_TAN_DZ","M1A_SC2_BL_DZ","Masada_DZ","Masada_SD_DZ","Masada_BL_DZ","Masada_BL_SD_DZ","MK14_DZ","MK14_SD_DZ","MK16_DZ","MK16_CCO_SD_DZ","MK16_BL_CCO_DZ","MK16_BL_Holo_SD_DZ","MK17_DZ","MK17_CCO_SD_DZ","MK17_ACOG_SD_DZ","MK17_BL_Holo_DZ","MK17_BL_GL_ACOG_DZ","MR43_DZ","PDR_DZ","RK95_DZ","RK95_SD_DZ","SCAR_H_AK_DZ","SteyrAug_A3_Green_DZ","SteyrAug_A3_Black_DZ","SteyrAug_A3_Blue_DZ","XM8_DZ","XM8_DES_DZ","XM8_GREY_DZ","XM8_GREY_2_DZ","XM8_GL_DZ","XM8_DES_GL_DZ","XM8_GREY_GL_DZ","XM8_Compact_DZ","XM8_DES_Compact_DZ","XM8_GREY_Compact_DZ","XM8_GREY_2_Compact_DZ","XM8_SD_DZ"];
local _snipers = ["Anzio_20_DZ","BAF_AS50_scoped_DZ","m107_DZ","KSVK_DZE"];
#define TITLE_COLOR "#FF0000" // Hint Option: Color of Top Line
#define TITLE_SIZE "1.75" // Hint Option: Size of top line
#define IMAGE_SIZE "4" // Hint Option: Size of the image
if (random 1 > _spawnChance and !_debug) exitWith {};
local _pos = [getMarkerPos "center",0,(((getMarkerSize "center") select 1)*0.75),10,0,.3,0] call BIS_fnc_findSafePos;
diag_log format["Special Forces Event spawning at %1", _pos];
local _lootPos = [_pos,0,(_radius - 100),10,0,2000,0] call BIS_fnc_findSafePos;
if (_debug) then {diag_log format["Special Forces Event: creating ammo box at %1", _lootPos];};
local _box = _crate createVehicle [0,0,0];
_box setPos _lootPos;
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;
if (random 1 < _sniperChance) then {
local _wep = _snipers call BIS_fnc_selectRandom;
_box addWeaponCargoGlobal [_wep,1];
local _ammoArray = getArray (configFile >> "CfgWeapons" >> _wep >> "magazines");
if (count _ammoArray > 0) then {
local _mag = _ammoArray select 0;
_box addMagazineCargoGlobal [_mag, (3 + round(random 2))];
};
};
for "_i" from 1 to _lootAmount do {
local _wep = _weapons call BIS_fnc_selectRandom;
_box addWeaponCargoGlobal [_wep,1];
local _ammoArray = getArray (configFile >> "CfgWeapons" >> _wep >> "magazines");
if (count _ammoArray > 0) then {
local _mag = _ammoArray select 0;
_box addMagazineCargoGlobal [_mag, (3 + floor(random 3))];
};
local _cfg = configFile >> "CfgWeapons" >> _wep >> "Attachments";
if (isClass _cfg && count _cfg > 0) then {
local _attach = configName (_cfg call BIS_fnc_selectRandom);
if !(_attach == "Attachment_Tws") then { // no thermal optics in regular game
_box addMagazineCargoGlobal [_attach,1];
};
};
};
local _pack = ["Patrol_Pack_DZE1","Assault_Pack_DZE1","Czech_Vest_Pouch_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","LargeGunBag_DZE1"] call BIS_fnc_selectRandom;
_box addBackpackCargoGlobal [_pack,1];
if (_type == "Hint") then {
local _img = getText (configFile >> "CfgWeapons" >> "UK59_DZ" >> "picture");
RemoteMessage = ["hintWithImage",["STR_CL_ESE_MILITARY_TITLE","STR_CL_ESE_MILITARY"],[_img,TITLE_COLOR,TITLE_SIZE,IMAGE_SIZE]];
} else {
RemoteMessage = ["titleText","STR_CL_ESE_MILITARY"];
};
publicVariable "RemoteMessage";
if (_debug) then {diag_log format["Special Forces Event setup, waiting for %1 minutes", _timeout];};
local _time = diag_tickTime;
local _done = false;
local _visited = false;
local _isNear = true;
local _markers = [1,1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_pos, format ["eventMark%1", _time], "ColorRed", "","ELLIPSE", "", [_radius, _radius], [], 0.5]];
if (_nameMarker) then {_markers set [1, [_pos, format ["eventDot%1",_time], "ColorBlack", "mil_dot","ICON", "", [], ["STR_CL_ESE_MILITARY_TITLE"], 0]];};
if (_markPos) then {_markers set [2, [_lootPos, format ["eventDebug%1",_time], "ColorRed", "mil_dot","ICON", "", [], [], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
while {!_done} do {
uiSleep 3;
if (_visitMark && !_visited) then {
{
if (isPlayer _x && {_x distance _box <= _distance}) exitWith {
_visited = true;
_markers set [3, [[(_pos select 0), (_pos select 1) + 25], format ["EventVisit%1", _time], "ColorBlack", "hd_pickup","ICON", "", [], [], 0]];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 3)];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
} count playableUnits;
};
if (_timeout != -1) then {
if (diag_tickTime - _time >= _timeout*60) then {
_done = true;
};
};
};
while {_isNear} do {
{if (isPlayer _x && _x distance _box >= _distance) exitWith {_isNear = false};} count playableUnits;
};
deleteVehicle _box;
// Tell all clients to remove the markers from the map
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, -1];
diag_log "Special Forces Event Ended";

View File

@ -0,0 +1,132 @@
/*
Original UN Supply Event by Aidem
Original "crate visited" marker concept and code by Payden
Rewritten and updated for DayZ Epoch 1.0.6+ by JasonTM
Updated for DayZ Epoch 1.0.7+ by JasonTM
Last update: 06-01-2021
*/
local _spawnChance = 1; // Percentage chance of event happening. The number must be between 0 and 1. 1 = 100% chance.
local _vaultChance = .25; // Percentage chance of safe or lockbox being added to the crate. The number must be between 0 and 1. 1 = 100% chance.
local _radius = 350; // Radius the loot can spawn and used for the marker
local _debug = false; // Diagnostic logs used for troubleshooting.
local _nameMarker = false; // Center marker with the name of the mission.
local _timeout = 3; // Time it takes for the event to time out (in minutes). To disable timeout set to -1.
local _markPos = true; // Puts a marker exactly were the loot spawns.
local _lootAmount = 50; // This is the number of times a random loot selection is made.
local _type = "TitleText"; // Type of announcement message. Options "Hint","TitleText". ***Warning: Hint appears in the same screen space as common debug monitors
local _visitMark = false; // Places a "visited" check mark on the mission if a player gets within range of the crate.
local _distance = 20; // Distance from crate before crate is considered "visited"
local _crate = "DZ_AmmoBoxBigUS"; // Class name of loot crate.
#define TITLE_COLOR "#0D00FF" // Hint Option: Color of Top Line
#define TITLE_SIZE "1.75" // Hint Option: Size of top line
#define IMAGE_SIZE "4" // Hint Option: Size of the image
local _bloodbag = ["bloodBagONEG","ItemBloodbag"] select dayz_classicBloodBagSystem;
local _lootList = [
"ItemAntibiotic3","ItemEpinephrine","ItemHeatPack","ItemMorphine","ItemBandage","ItemAntibacterialWipe","ItemPainkiller6","ItemSepsisBandage","equip_woodensplint","ItemKiloHemp",_bloodbag, // meds
"FoodCanBakedBeans","FoodCanFrankBeans","FoodCanPasta","FoodCanSardines","FoodCanBeef","FoodCanPotatoes","FoodCanGriff","FoodCanBadguy","FoodCanBoneboy","FoodCanCorn","FoodCanCurgon","FoodCanDemon","FoodCanFraggleos","FoodCanHerpy","FoodCanDerpy","FoodCanOrlok","FoodCanPowell","FoodCanTylers","FoodCanUnlabeled","FoodCanRusUnlabeled","FoodCanRusStew","FoodCanRusPork","FoodCanRusPeas","FoodCanRusMilk","FoodCanRusCorn","FoodChipsSulahoops","FoodChipsMysticales","FoodChipsChocolate","FoodCandyChubby","FoodCandyAnders","FoodCandyLegacys","FoodCakeCremeCakeClean","FoodCandyMintception","FoodPistachio","FoodNutmix","FoodMRE","FoodbaconCooked","FoodbeefCooked","FoodchickenCooked","FoodGoatCooked","FoodmuttonCooked","FoodrabbitCooked","FishCookedTrout","FishCookedSeaBass","FishCookedTuna", // food
"ItemSodaCoke","ItemSodaPepsi","ItemSodaMdew","ItemSodaMtngreen","ItemSodaR4z0r","ItemSodaClays","ItemSodaSmasht","ItemSodaDrwaste","ItemSodaFranka","ItemSodaLemonade","ItemSodaLirik","ItemSodaLvg","ItemSodaMzly","ItemSodaPeppsy","ItemSodaRabbit","ItemSodaSacrite","ItemSodaRocketFuel","ItemSodaGrapeDrink","ItemSherbet","ItemSodaRbull","ItemSodaOrangeSherbet","ItemWaterbottle","ItemWaterBottleSafe","ItemWaterBottleBoiled","ItemWaterBottleHerbal","ItemPlasticWaterBottleSafe","ItemPlasticWaterBottleBoiled","ItemPlasticWaterBottleHerbal", // drink
"PartFueltank","PartWheel","PartEngine","PartGlass","PartGeneric","PartVRotor","ItemJerrycan","ItemFuelBarrel","equip_hose", // vehicle parts
"ItemCanvas","ItemTent","ItemTentWinter","ItemDomeTent","ItemWinterDomeTent","ItemDesertTent","equip_floppywire","equip_scrapelectronics","equip_rope","equip_tent_poles" // tents and stuff
];
local _tools = ["ItemToolbox","ItemToolbox","ItemKnife","ItemEtool","ItemGPS","Binocular_Vector","NVGoggles_DZE","ItemHatchet","ItemCrowbar","ItemSledge"];
if (random 1 > _spawnChance and !_debug) exitWith {};
local _pos = [getMarkerPos "center",0,(((getMarkerSize "center") select 1)*0.75),10,0,.3,0] call BIS_fnc_findSafePos;
diag_log format["UN Supply Drop Event spawning at %1", _pos];
local _lootPos = [_pos,0,(_radius * .75),10,0,2000,0] call BIS_fnc_findSafePos;
if (_debug) then {diag_log format["UN Supply Drop: creating ammo box at %1", _lootPos];};
local _box = _crate createVehicle [0,0,0];
_box setPos _lootPos;
clearMagazineCargoGlobal _box;
clearWeaponCargoGlobal _box;
if (random 1 < _vaultChance) then {
local _vault = ["ItemVault","ItemLockbox"] call BIS_fnc_selectRandom;
_box addMagazineCargoGlobal [_vault,1];
};
for "_i" from 1 to _lootAmount do {
local _loot = _lootList call BIS_fnc_selectRandom;
_box addMagazineCargoGlobal [_loot,1];
};
for "_i" from 1 to 5 do {
local _tool = _tools call BIS_fnc_selectRandom;
_box addWeaponCargoGlobal [_tool,1];
};
local _pack = ["Patrol_Pack_DZE1","Assault_Pack_DZE1","Czech_Vest_Pouch_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","LargeGunBag_DZE1"] call BIS_fnc_selectRandom;
_box addBackpackCargoGlobal [_pack,1];
if (_type == "Hint") then {
local _img = (getText (configFile >> "CfgVehicles" >> "Mi17_UN_CDF_EP1" >> "picture"));
RemoteMessage = ["hintWithImage",["STR_CL_ESE_UNSUPPLY_TITLE","STR_CL_ESE_UNSUPPLY"],[_img,TITLE_COLOR,TITLE_SIZE,IMAGE_SIZE]];
} else {
RemoteMessage = ["titleText","STR_CL_ESE_UNSUPPLY"];
};
publicVariable "RemoteMessage";
if (_debug) then {diag_log format["U.N. Supply Drop Event setup, waiting for %1 minutes", _timeout];};
local _time = diag_tickTime;
local _done = false;
local _visited = false;
local _isNear = true;
local _markers = [1,1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_pos, format ["eventMark%1", _time], "ColorBlue", "","ELLIPSE", "", [_radius, _radius], [], 0.5]];
if (_nameMarker) then {_markers set [1, [_pos, format ["eventDot%1",_time], "ColorBlack", "mil_dot","ICON", "", [], ["STR_CL_ESE_UNSUPPLY_TITLE"], 0]];};
if (_markPos) then {_markers set [2, [_lootPos, format ["eventDebug%1",_time], "ColorBlue", "mil_dot","ICON", "", [], [], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
while {!_done} do {
uiSleep 3;
if (_visitMark && !_visited) then {
{
if (isPlayer _x && {_x distance _box <= _distance}) exitWith {
_visited = true;
_markers set [3, [[(_pos select 0), (_pos select 1) + 25], format ["EventVisit%1", _time], "ColorBlack", "hd_pickup","ICON", "", [], [], 0]];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 3)];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
} count playableUnits;
};
if (_timeout != -1) then {
if (diag_tickTime - _time >= _timeout*60) then {
_done = true;
};
};
};
while {_isNear} do {
{if (isPlayer _x && _x distance _box >= _distance) exitWith {_isNear = false};} count playableUnits;
};
deleteVehicle _box;
// Tell all clients to remove the markers from the map
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, -1];
diag_log "EVENT: U.N. Supply Crate Ended";