mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-11 18:52:56 +03:00
added supply drops with building supplies
This commit is contained in:
@@ -1983,7 +1983,31 @@ class HeliCrash_No50s: Default {
|
||||
0.03
|
||||
};
|
||||
};
|
||||
|
||||
class SupplyDrop: Default {
|
||||
zombieChance = 1;
|
||||
maxRoaming = 3;
|
||||
zombieClass[] = {"zZombie_Base","z_hunter","z_hunter","z_hunter","z_villager1","z_villager2","z_villager3","z_doctor","z_soldier_pilot","z_soldier_heavy"};
|
||||
lootChance = 1;
|
||||
lootPos[] = {};
|
||||
itemType[] = {
|
||||
{ "PartPlywoodPack","magazine" },
|
||||
{ "PartPlankPack","magazine" },
|
||||
{ "CinderBlocks","magazine" },
|
||||
{ "MortarBucket","magazine" },
|
||||
{ "bulk_PartGeneric","magazine" },
|
||||
{ "bulk_ItemSandbag","magazine"},
|
||||
{ "bulk_ItemTankTrap","magazine"},
|
||||
};
|
||||
itemChance[] = {
|
||||
0.20,
|
||||
0.15,
|
||||
0.10,
|
||||
0.10,
|
||||
0.20,
|
||||
0.10,
|
||||
0.15,
|
||||
};
|
||||
};
|
||||
class MassGrave: Default {
|
||||
zombieChance = 1;
|
||||
maxRoaming = 3;
|
||||
|
||||
58
SQF/dayz_server/modules/supply_drop.sqf
Normal file
58
SQF/dayz_server/modules/supply_drop.sqf
Normal file
@@ -0,0 +1,58 @@
|
||||
private ["_guaranteedLoot","_randomizedLoot","_spawnChance","_spawnMarker","_spawnRadius","_crashModel","_lootTable","_spawnRoll","_position","_crash","_config","_num","_itemTypes","_index","_weights","_cntWeights","_nearby","_itemType"];
|
||||
|
||||
_guaranteedLoot = 4;
|
||||
_randomizedLoot = 8;
|
||||
_spawnChance = 0.50;
|
||||
_spawnMarker = 'center';
|
||||
_spawnRadius = (HeliCrashArea/2);
|
||||
|
||||
_spawnRoll = random 1;
|
||||
if (_spawnRoll <= _spawnChance) then {
|
||||
|
||||
_crashModel = ["Misc_cargo_cont_tiny"] call BIS_fnc_selectRandom;
|
||||
|
||||
_lootTable = "SupplyDrop";
|
||||
|
||||
//_crashName = getText (configFile >> "CfgVehicles" >> _crashModel >> "displayName");
|
||||
|
||||
_position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
|
||||
|
||||
//diag_log(format["CRASHSPAWNER: Spawning '%1' with loot table '%2' NOW! (%3) at: %4", _crashName, _lootTable, time, str(_position)]);
|
||||
|
||||
_crash = createVehicle [_crashModel,_position, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
// Randomize the direction the wreck is facing
|
||||
_crash setDir round(random 360);
|
||||
|
||||
_crash setPos _position;
|
||||
|
||||
// I don't think this is needed (you can't get "in" a crash), but it was in the original DayZ Crash logic
|
||||
//dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_crash];
|
||||
|
||||
//_crash setVariable ["ObjectID","1",true];
|
||||
|
||||
// Disable simulation server side
|
||||
_crash enableSimulation false;
|
||||
|
||||
_num = (round(random _randomizedLoot)) + _guaranteedLoot;
|
||||
|
||||
_config = configFile >> "CfgBuildingLoot" >> _lootTable;
|
||||
_itemTypes = [] + getArray (_config >> "itemType");
|
||||
_index = dayz_CBLBase find toLower(_lootTable);
|
||||
_weights = dayz_CBLChances select _index;
|
||||
_cntWeights = count _weights;
|
||||
|
||||
for "_x" from 1 to _num do {
|
||||
//create loot
|
||||
_index = floor(random _cntWeights);
|
||||
_index = _weights select _index;
|
||||
_itemType = _itemTypes select _index;
|
||||
[_itemType select 0, _itemType select 1, _position, 5] call spawn_loot;
|
||||
};
|
||||
|
||||
// ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items.
|
||||
_nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)];
|
||||
{
|
||||
_x setVariable ["permaLoot",true];
|
||||
} forEach _nearBy;
|
||||
};
|
||||
Reference in New Issue
Block a user