mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Upload new versions of events to be run by the event spawner
Epoch has been running the Vanilla Mod versions since the 1.0.6 update. These files are designed to run on Epoch's built in event spawner.
This commit is contained in:
75
SQF/dayz_server/modules/Care_Packages.sqf
Normal file
75
SQF/dayz_server/modules/Care_Packages.sqf
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
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
|
||||
|
||||
#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]]]
|
||||
|
||||
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];
|
||||
|
||||
switch (dayz_spawncarepkgs_clutterCutter) do
|
||||
{
|
||||
case 1: //Lift loot up by 5cm
|
||||
{
|
||||
_lootPos set [2, 0.05];
|
||||
_lootVeh setPosATL _lootpos;
|
||||
};
|
||||
|
||||
case 2: //Clutter cutter
|
||||
{
|
||||
//createVehicle ["ClutterCutter_small_2_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
|
||||
"ClutterCutter_small_2_EP1" createVehicle _lootPos;
|
||||
};
|
||||
|
||||
case 3: //Debug sphere
|
||||
{
|
||||
//createVehicle ["Sign_sphere100cm_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
|
||||
"Sign_sphere100cm_EP1" createVehicle _lootPos;
|
||||
};
|
||||
};
|
||||
} forEach Loot_Select(_lootGroup, _lootNum);
|
||||
};
|
||||
93
SQF/dayz_server/modules/CrashSites.sqf
Normal file
93
SQF/dayz_server/modules/CrashSites.sqf
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
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
|
||||
|
||||
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];
|
||||
|
||||
switch (dayz_spawnCrashSite_clutterCutter) do
|
||||
{
|
||||
case 1: //Lift loot up by 5cm
|
||||
{
|
||||
_lootPos set [2, 0.05];
|
||||
_lootVeh setPosATL _lootpos;
|
||||
};
|
||||
|
||||
case 2: //Clutter cutter
|
||||
{
|
||||
//createVehicle ["ClutterCutter_small_2_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
|
||||
"ClutterCutter_small_2_EP1" createVehicle _lootPos;
|
||||
};
|
||||
|
||||
case 3: //Debug sphere
|
||||
{
|
||||
//createVehicle ["Sign_sphere100cm_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
|
||||
"Sign_sphere100cm_EP1" createVehicle _lootPos;
|
||||
};
|
||||
};
|
||||
}
|
||||
forEach Loot_Select(_lootGroup, _lootNum);
|
||||
};
|
||||
|
||||
//Spawn crash sites
|
||||
for "_i" from 1 to (NUMBER) do
|
||||
{
|
||||
call _spawnCrashSite;
|
||||
};
|
||||
70
SQF/dayz_server/modules/CrashSites_Old.sqf
Normal file
70
SQF/dayz_server/modules/CrashSites_Old.sqf
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
This file was imported from DayZ Epoch 1.0.5.1 and updated for use in v1.06+ by JasonTM.
|
||||
This version uses the old "SpawnableWreck" classes.
|
||||
*/
|
||||
|
||||
#include "\z\addons\dayz_code\loot\Loot.hpp"
|
||||
|
||||
#define SEARCH_BLACKLIST [[[2092,14167],[10558,12505]]] // Map area black list. Default is for Chernarus.
|
||||
#define LOWER_GRASS true // Lowers the grass around the loot.
|
||||
#define MIN_LOOT_RADIUS 4 // Minimum distance for loot to spawn from the crash site in meters.
|
||||
#define MAX_LOOT_RADIUS 10 // Maximum distance for loot to spawn from the crash site in meters.
|
||||
#define SPAWN_FIRE false // Visual effect of burning wreck. (may negatively affect fps)
|
||||
#define FADE_FIRE false // Fades the burning effect over time.
|
||||
#define NUMBER 3 //Number of crash sites to spawn at the beginning of the mission.
|
||||
#define LOOT_MIN 10 // Minimum number of loot items to spawn per site.
|
||||
#define LOOT_MAX 15 // Maximum number of loot items to spawn per site.
|
||||
|
||||
private ["_spawnCrashSite","_class","_crashName","_position","_crash","_type","_lootGroup","_lootRadius","_lootPos","_lootVeh","_lootNum"];
|
||||
|
||||
_spawnCrashSite = {
|
||||
|
||||
_class = ["UH60_NAVY_Wreck_DZ","UH60_ARMY_Wreck_DZ","UH60_NAVY_Wreck_burned_DZ","UH60_ARMY_Wreck_burned_DZ","Mass_grave_DZ"] call BIS_fnc_selectRandom;
|
||||
_crashName = getText (configFile >> "CfgVehicles" >> _class >> "displayName");
|
||||
|
||||
_position = [getMarkerPos "crashsites", 0, (getMarkerSize "crashsites") select 0, 20, 0, 0.3, 0, SEARCH_BLACKLIST] call BIS_fnc_findSafePos;
|
||||
|
||||
_crash = _class createVehicle [0,0,0];
|
||||
_crash setDir random 360;
|
||||
_position set [2, 0];
|
||||
_crash setPos _position;
|
||||
_crash setVariable ["ObjectID","1",true];
|
||||
_crash enableSimulation false;
|
||||
|
||||
if (SPAWN_FIRE && {!(_class == "Mass_grave_DZ")}) then {
|
||||
PVDZ_obj_Fire = [_crash, 4, time, false, FADE_FIRE];
|
||||
publicVariable "PVDZ_obj_Fire";
|
||||
_crash setvariable ["fadeFire",FADE_FIRE,true];
|
||||
};
|
||||
|
||||
// Select random crash site loot
|
||||
_type = Loot_SelectSingle(Loot_GetGroup("CrashSiteType"));
|
||||
if(_class == "Mass_grave_DZ") then {
|
||||
_lootGroup = Loot_GetGroup("MassGrave");
|
||||
} else {
|
||||
_lootGroup = Loot_GetGroup(_type select 2);
|
||||
};
|
||||
|
||||
// Calculate loot amount
|
||||
_lootNum = round (LOOT_MIN + random (LOOT_MAX - LOOT_MIN));
|
||||
|
||||
diag_log format ["CRASHSPAWNER: Spawning crash site (%1) at %2 with %3 items.", _crashName, _position, _lootNum];
|
||||
|
||||
{
|
||||
_lootRadius = (random MAX_LOOT_RADIUS) + MIN_LOOT_RADIUS;
|
||||
_lootPos = [_position, _lootRadius, random 360] call BIS_fnc_relPos;
|
||||
_lootPos set [2, 0];
|
||||
_lootVeh = Loot_Spawn(_x, _lootPos);
|
||||
_lootVeh setVariable ["permaLoot", true];
|
||||
//_lootArray set[count _lootArray, _lootVeh];
|
||||
if (LOWER_GRASS) then {
|
||||
createVehicle ["ClutterCutter_small_2_EP1", _lootPos, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
} forEach Loot_Select(_lootGroup,_lootNum);
|
||||
};
|
||||
|
||||
// Spawn crash sites
|
||||
for "_i" from 1 to (NUMBER) do
|
||||
{
|
||||
call _spawnCrashSite;
|
||||
};
|
||||
91
SQF/dayz_server/modules/Infected_Camps.sqf
Normal file
91
SQF/dayz_server/modules/Infected_Camps.sqf
Normal 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));
|
||||
};
|
||||
Reference in New Issue
Block a user