1.7.5.D1222

This commit is contained in:
A Clark
2012-12-24 10:33:50 -06:00
parent 6e664d72c2
commit de7f3a17d0
16 changed files with 330 additions and 288 deletions

View File

@@ -1,23 +1,42 @@
private["_obj","_type","_config","_canLoot","_originalPos","_unitTypes","_min","_max","_num","_clean","_positions","_zombieChance","_rnd","_iPos","_nearBy","_nearByPlayer"];_obj = _this select 0; private["_obj","_type","_config","_canLoot","_originalPos","_unitTypes","_min","_max","_num","_clean","_positions","_zombieChance","_rnd","_iPos","_nearBy","_nearByPlayer"];_obj = _this select 0;
_obj = _this select 0;
_type = typeOf _obj; _type = typeOf _obj;
_config = configFile >> "CfgBuildingLoot" >> _type; _config = configFile >> "CfgBuildingLoot" >> _type;
_canLoot = isClass (_config); _canLoot = isClass (_config);
_originalPos = getPosATL _obj; _originalPos = getPosATL _obj;
if (_canLoot) then { if (_canLoot) then {
//Get zombie class //Get zombie class
_unitTypes = getArray (_config >> "zombieClass"); _unitTypes = getArray (_config >> "zombieClass");
_min = getNumber (_config >> "maxRoaming"); _min = getNumber (_config >> "maxRoaming");
_max = getNumber (_config >> "minRoaming"); _max = getNumber (_config >> "minRoaming");
//Walking Zombies //Walking Zombies
_num = round(random _max) max _min; // + round(_max / 3); _num = round(random _max) max _min;
_config = configFile >> "CfgBuildingLoot" >> _type;
//Get zombie class
_zombieChance = getNumber (_config >> "zombieChance");
_rnd = random 1;
if (_rnd < _zombieChance) then {
_noPlayerNear = (count ((getPosATL _obj) nearEntities ["CAManBase",30])) == 0;
if (_noPlayerNear) then {
_position = _obj buildingExit 0;
if ((_position select 0) == 0) then {
_position = getPosATL _obj;
};
//diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num)); //diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num));
for "_i" from 1 to _num do for "_i" from 1 to _num do
{ {
[_originalPos,_unitTypes] call zombie_generate; [_originalPos,_unitTypes] call zombie_generate;
};
}; };
};
/*
//Add Internal Zombies //Add Internal Zombies
_clean = count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0; _clean = count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0;
if (_clean) then { if (_clean) then {
@@ -30,8 +49,8 @@ if (_canLoot) then {
_iPos = _obj modelToWorld _x; _iPos = _obj modelToWorld _x;
//_iPos = [_iPos,0,20,20,0,0,0] call BIS_fnc_findSafePos; //_iPos = [_iPos,0,20,20,0,0,0] call BIS_fnc_findSafePos;
//_iPos = position (_obj); //_iPos = position (_obj);
_nearBy = count nearestObjects [_iPos, ["zZombie_Base"],1] > 0; _nearBy = count nearestObjects [_iPos , ["zZombie_Base"],1] > 0;
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0; _nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;
//diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer)); //diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer));
if (!_nearByPlayer and !_nearBy) then { if (!_nearByPlayer and !_nearBy) then {
@@ -41,4 +60,5 @@ if (_canLoot) then {
} forEach _positions; } forEach _positions;
}; };
dayz_buildingMonitor set [count dayz_buildingMonitor,_obj]; dayz_buildingMonitor set [count dayz_buildingMonitor,_obj];
*/
}; };

View File

@@ -117,7 +117,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
}; };
*/ */
//flip vehicle //flip vehicle
if ((_isVehicletype) and !_canmove and _isAlive and (player distance cursorTarget >= 2)) then { if ((_isVehicletype) and !_canmove and _isAlive and (player distance cursorTarget >= 2) and (count (crew cursorTarget))== 0 and ((vectorUp cursorTarget) select 2) < 0.5) then {
if (s_player_flipveh < 0) then { if (s_player_flipveh < 0) then {
s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",cursorTarget, 1, true, true, "", ""]; s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",cursorTarget, 1, true, true, "", ""];
}; };

View File

@@ -1,114 +1,83 @@
private["_type","_isAir","_inVehicle","_dateNow","_maxZombies","_maxWildZombies","_age","_nearbyBuildings","_radius","_locationstypes","_nearestCity","_position","_nearbytype"];
_type = _this select 0;
_isAir = vehicle player iskindof "Air"; _isAir = vehicle player iskindof "Air";
_inVehicle = (vehicle player != player); _inVehicle = (vehicle player != player);
_dateNow = (DateToNumber date); _dateNow = (DateToNumber date);
_maxZombies = dayz_maxLocalZombies; _maxZombies = dayz_maxLocalZombies;
_maxWildZombies = 3;
_age = -1; _age = -1;
// If they just got out of a vehicle, boost their per-player zombie limit by 5 in hopes of allowing insta-spawn zombies _nearbyBuildings = [];
diag_log ("Type: " +str(_type));
if (dayz_inVehicle and !_inVehicle) then {
dayz_spawnWait = -300;
//_maxZombies = _maxZombies + 2;
};
dayz_inVehicle = _inVehicle;
//if (((time - dayz_spawnWait) < dayz_spawnDelay) or ((time - dayz_lootWait) < dayz_lootDelay)) exitWith {diag_log("Skipping Check since neither loot or zombies are ready");};
//if (((time - dayz_spawnWait) < dayz_spawnDelay) and ((time - dayz_lootWait) < dayz_lootDelay)) exitWith {};
//diag_log("SPAWN CHECKING: Starting"); //diag_log("SPAWN CHECKING: Starting");
_radius = 300; _radius = 300;
_locationstypes = ["NameCityCapital","NameCity","NameVillage","NameLocal"]; _locationstypes = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
_nearestCity = nearestLocations [getPos player, _locationstypes, _radius]; _nearestCity = nearestLocations [getPos player, _locationstypes, _radius];
_townname = text (_nearestCity select 0);
//_nearestCity = [_locationstypes,[position player,600],false] call bis_fnc_locations;
//diag_log ("0: " +str(_nearestCity)); _position = getPosATL player;
if ((count _nearestCity) > 0) then {
_position = getPosATL player; _position = position (_nearestCity select 0);
if ((count _nearestCity) > 0) then { };
_position = position (_nearestCity select 0);
}; _nearbytype = type (_nearestCity select 0);
_nearbytype = type (_nearestCity select 0);
switch (_nearbytype) do { switch (_nearbytype) do {
case "Hill": { case "NameLocal": {
_radius = 50; _radius = 200;
_maxZombies = 30; _maxZombies = 30;
}; };
case "NameLocal": {
_radius = 100;
_maxZombies = 40;
};
case "NameVillage": { case "NameVillage": {
_radius = 150; _radius = 250;
_maxZombies = 60; _maxZombies = 40;
}; };
case "NameCity": { case "NameCity": {
_radius = 200; _radius = 300;
_maxZombies = 80; _maxZombies = 45;
}; };
case "NameCityCapital": { case "NameCityCapital": {
_radius = 300; _radius = 400;
_maxZombies = 100; _maxZombies = 50;
}; };
default { default {
_radius = 100; _radius = 200;
_maxZombies = 40; _maxZombies = 20;
}; };
}; };
_nearby = _position nearObjects ["Building",_radius]; /*
if ((count _nearestCity) > 0) then {
if (_inVehicle) then { _markerstr = createMarker["markername_" +str (_townname), _position];
_maxZombies = _maxZombies / 2; _markerstr setMarkerText _townname;
_markerstr setMarkerColor "ColorGreen";
_markerstr setMarkerShape "ELLIPSE";
_markerstr setMarkerBrush "Grid";
_markerstr setMarkerSize [_radius, _radius];
}; };
_tooManyZs = count (_position nearEntities ["zZombie_Base",_radius * 2]) > _maxZombies; deleteMarker "Player_Marker_Radius";
{ _markerstr = createMarker["Player_Marker_Radius", getPosATL player];
//diag_log("SPAWN CHECK: Start of Loop"); _markerstr setMarkerColor "ColorRed";
_type = typeOf _x; _markerstr setMarkerShape "ELLIPSE";
_config = configFile >> "CfgBuildingLoot" >> _type; _markerstr setMarkerBrush "Border";
_canZombie = isClass (_config); _markerstr setMarkerSize [_radius, _radius];
_canLoot = ((count (getArray (_config >> "lootPos"))) > 0); */
_dis = _x distance player;
//diag_log ("Type: " +str(sizeOf _type));
if ((!_inVehicle) and (_canLoot)) then { switch (_type) do {
_keepAwayDist = ((sizeOf _type)+5); case "Zeds": {
_isNoone = {isPlayer _x} count (_x nearEntities ["CAManBase",_keepAwayDist]) == 0; _spawnZombies = count (getPosATL player nearEntities ["zZombie_Base",_radius]) < _maxZombies;
if (_isNoone) then { if (_spawnZombies) then {
_looted = (_x getVariable ["looted",0.0]); _nearbyBuildings = _position nearObjects ["building",_radius];
_cleared = (_x getVariable ["cleared",true]); //_nearbyBuildings = nearestObjects [getPosATL player, dayz_ZombieBuildings, _radius]; //Cant be used Not all zones are covered yet (wrecks, Buildings outside towns)
_dateNow = (DateToNumber date); [_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _maxZombies, _nearbyBuildings] call player_spawnzedCheck;
_age = (_dateNow - _looted) * 525948; };
if (_age > 8) then { };
_x setVariable ["looted",_dateNow,true]; case "Loot": {
[_x] call building_spawnLoot; _nearbyBuildings = _position nearObjects ["building",_radius];
}; //_nearbyBuildings = nearestObjects [_position, dayz_LootBuildings, _radius]; //Cant be used Not all zones are covered yet (wrecks, Buildings outside towns)
}; [_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _nearbyBuildings] call player_spawnlootCheck;
}; };
};
if (_canZombie) then {
if (dayz_spawnZombies < _maxZombies) then {
if (!_tooManyZs) then {
private["_zombied"];
_zombied = (_x getVariable ["zombieSpawn",-0.1]);
_dateNow = (DateToNumber date);
_age = (_dateNow - _zombied) * 525948;
//diag_log(format["Date: %1 | ZombieSpawn: %2 | age: %3 | building: %4 (%5)", _dateNow, _zombied, _age, str(_x), _dis]);
if (_age > 1) then {
_bPos = getPosATL _x;
_zombiesNum = count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]);
//diag_log ("ZombiesNum: " +str(_zombiesNum));
if (_zombiesNum == 0) then {
//Randomize Zombies
_x setVariable ["zombieSpawn",_dateNow,true];
[_x] call building_spawnZombies;
};
};
};
};
};
} forEach _nearby;

View File

@@ -1,41 +1,28 @@
private["_isAir","_inVehicle","_dateNow","_age","_radius","_locationstypes","_nearestCity","_position","_nearby","_type","_config","_canZombie","_canLoot","_dis","_keepAwayDist","_isNoone","_looted","_cleared"]; private["_radius","_position","_inVehicle","_dateNow","_age","_locationstypes","_nearestCity","_nearbyBuildings","_nearby","_type","_config","_canZombie","_canLoot","_dis","_keepAwayDist","_isNoone","_looted","_cleared"];//_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _nearbyBuildings
_isAir = vehicle player iskindof "Air";
_inVehicle = (vehicle player != player);
_dateNow = (DateToNumber date);
_age = -1;
_radius = 300; _radius = _this select 0;
_locationstypes = ["NameCityCapital","NameCity","NameVillage","NameLocal"]; _position = _this select 1;
_nearestCity = nearestLocations [getPos player, _locationstypes, _radius]; _inVehicle = _this select 2;
_dateNow = _this select 3;
_position = getPosATL player; _age = _this select 4;
if ((count _nearestCity) > 0) then { _locationstypes = _this select 5;
_position = position (_nearestCity select 0); _nearestCity = _this select 6;
}; _nearby = _this select 7;
//_nearby = _position nearObjects ["Building",_radius / 2]; diag_log ("Loot Started");
_nearby = nearestObjects [_position, ["Building"], _radius];
{
//diag_log("SPAWN CHECK: Start of Loop");
_type = typeOf _x;
_config = configFile >> "CfgBuildingLoot" >> _type;
_canZombie = isClass (_config);
_canLoot = ((count (getArray (_config >> "lootPos"))) > 0);
_dis = _x distance player;
if ((!_inVehicle) and (_canLoot)) then { {
if (!_inVehicle) then {
_looted = (_x getVariable ["looted",-0.1]);
_dateNow = (DateToNumber date);
_age = (_dateNow - _looted) * 525948;
if (_age > 8) then {
_keepAwayDist = ((sizeOf _type) + 5); _keepAwayDist = ((sizeOf _type) + 5);
_isNoone = {isPlayer _x} count (_x nearEntities ["CAManBase",_keepAwayDist]) == 0; _noPlayerNear = (count ((getPosATL _x) nearEntities ["CAManBase",_keepAwayDist])) == 0;
if (_isNoone) then { if (_noPlayerNear) then {
_looted = (_x getVariable ["looted",0.0]); _x setVariable ["looted",_dateNow,true];
_cleared = (_x getVariable ["cleared",true]); [_x] call building_spawnLoot;
_dateNow = (DateToNumber date);
_age = (_dateNow - _looted) * 525948;
if (_age > 8) then {
_x setVariable ["looted",_dateNow,true];
[_x] call building_spawnLoot;
};
}; };
}; };
} forEach _nearby; };
} forEach _nearby;

View File

@@ -1,10 +1,16 @@
private["_isAir","_inVehicle","_dateNow","_maxZombies","_spawnDelay","_age","_radius","_locationstypes","_nearestCity","_position","_nearbytype","_tooManyZs","_nearbyplayer","_type","_config","_canZombie","_dis","_zombied","_bPos","_zombiesNum","_withinRange"]; private["_radius","_position","_inVehicle","_dateNow","_age","_locationstypes","_nearestCity","_maxZombies","_nearby","_maxWildZombies","_tooManyZs","_tooManyWildZs","_type","_config","_canZombie","_dis","_zombied","_bPos","_zombiesNum","_withinRange","_spawnWildZs"];
_radius = _this select 0;
_position = _this select 1;
_inVehicle = _this select 2;
_dateNow = _this select 3;
_age = _this select 4;
_locationstypes = _this select 5;
_nearestCity = _this select 6;
_maxZombies = _this select 7;
_nearby = _this select 8;
_isAir = vehicle player iskindof "Air"; diag_log ("Zed Started");
_inVehicle = (vehicle player != player); _maxWildZombies = 3;
_dateNow = (DateToNumber date);
_maxZombies = dayz_maxLocalZombies;
_age = -1;
// If they just got out of a vehicle, boost their per-player zombie limit by 5 in hopes of allowing insta-spawn zombies // If they just got out of a vehicle, boost their per-player zombie limit by 5 in hopes of allowing insta-spawn zombies
if (dayz_inVehicle and !_inVehicle) then { if (dayz_inVehicle and !_inVehicle) then {
@@ -14,80 +20,42 @@ if (dayz_inVehicle and !_inVehicle) then {
dayz_inVehicle = _inVehicle; dayz_inVehicle = _inVehicle;
//diag_log("SPAWN CHECKING: Starting");
_radius = 300;
_locationstypes = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
_nearestCity = nearestLocations [getPos player, _locationstypes, _radius];
_position = getPosATL player;
if ((count _nearestCity) > 0) then {
_position = position (_nearestCity select 0);
};
_nearbytype = type (_nearestCity select 0);
switch (_nearbytype) do {
case "NameLocal": {
_radius = 200;
_maxZombies = 30;
};
case "NameVillage": {
_radius = 250;
_maxZombies = 40;
};
case "NameCity": {
_radius = 300;
_maxZombies = 45;
};
case "NameCityCapital": {
_radius = 400;
_maxZombies = 50;
};
default {
_radius = 180;
_maxZombies = 20;
};
};
if (_inVehicle) then { if (_inVehicle) then {
_maxZombies = _maxZombies / 2; _maxZombies = _maxZombies / 2;
_maxWildZombies = 0;
}; };
_spawnZombies = count (_position nearEntities ["zZombie_Base",_radius]) < _maxZombies;
_tooManyZs = count (_position nearEntities ["zZombie_Base",_radius]) > _maxZombies; // _tooManyZs = count (_position nearEntities ["zZombie_Base",_radius]) > _maxZombies;
_nearby = nearestObjects [player, ["Building"], _radius]; // _tooManyWildZs = count (_position nearEntities ["zZombie_Base",_radius]) > _maxWildZombies;
//_nearby = _position nearObjects ["building",_radius];
{ {
_type = typeOf _x; if (dayz_spawnZombies > _maxZombies) exitwith {};
_config = configFile >> "CfgBuildingLoot" >> _type; _zombied = (_x getVariable ["zombieSpawn",-0.1]);
_canZombie = isClass (_config); _dateNow = (DateToNumber date);
_dis = _x distance player; _age = (_dateNow - _zombied) * 525948;
//diag_log(format["Date: %1 | ZombieSpawn: %2 | age: %3 | building: %4 (%5)", _dateNow, _zombied, _age, str(_x), _dis]);
if (_canZombie) then { if (_age > 1) then {
//if ((time - dayz_spawnWait) > dayz_spawnDelay) then { //_withinRange = _x distance player < 200;
if (dayz_spawnZombies < _maxZombies) then { //if (_withinRange) then {
if (!_tooManyZs) then { _x setVariable ["zombieSpawn",_dateNow,true];
private["_zombied"]; [_x] call building_spawnZombies;
_zombied = (_x getVariable ["zombieSpawn",-0.1]); //};
_dateNow = (DateToNumber date); };
_age = (_dateNow - _zombied) * 525948;
//diag_log(format["Date: %1 | ZombieSpawn: %2 | age: %3 | building: %4 (%5)", _dateNow, _zombied, _age, str(_x), _dis]);
if (_age > 1) then {
_bPos = getPosATL _x;
_zombiesNum = count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]);
_withinRange = _x distance player < _radius;
//diag_log ("ZombiesNum: " +str(_zombiesNum));
if ((_zombiesNum == 0) and _withinRange) then {
//if (_zombiesNum == 0) then {
//Randomize Zombies
_x setVariable ["zombieSpawn",_dateNow,true];
[_x] call building_spawnZombies;
};
};
};
} else {
dayz_spawnWait = time;
dayz_spawnZombies = count (_position nearEntities ["zZombie_Base",_radius]);
};
};
} forEach _nearby; } forEach _nearby;
_running = 0 /*
if ((count _nearby) < 1) then {
diag_log ("1");
_spawnWildZs = count (_position nearEntities ["zZombie_Base",_radius]);
if (_spawnWildZs < _maxWildZombies) then {
diag_log ("2");
if (!_tooManyWildZs) then {
diag_log ("3");
_zombiesNum = count (_position nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]);
//diag_log ("ZombiesNum: " +str(_zombiesNum));
if (_zombiesNum == 0) then {
diag_log ("4");
[_position] call wild_spawnZombies;
};
};
};
};
*/

View File

@@ -3,7 +3,7 @@ _position = _this select 0;
_unitTypes = _this select 1; _unitTypes = _this select 1;
_doLoiter = true; _doLoiter = true;
_isNoone = {isPlayer _x} count (_position nearEntities ["AllVehicles",30]) == 0; _isNoone = {isPlayer _x} count (_position nearEntities ["CAManBase",30]) == 0;
_loot = ""; _loot = "";
_array = []; _array = [];
_agent = objNull; _agent = objNull;
@@ -24,26 +24,21 @@ if (_doLoiter) then {
_radius = 40; _radius = 40;
_method = "NONE"; _method = "NONE";
}; };
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
//diag_log ("Spawned: " + str([_type, _position, [], _radius, _method])); //diag_log ("Spawned: " + str([_type, _position, [], _radius, _method]));
if (_nearByPlayer) then {
_position = [_position,25,80,10,0,0,0] call BIS_fnc_findSafePos;
};
_agent = createAgent [_type, _position, [], _radius, _method]; _agent = createAgent [_type, _position, [], _radius, _method];
if (_doLoiter) then { if (_doLoiter) then {
//_agent setPosATL _position; _agent setPosATL _position;
//_agent setVariable ["doLoiter",true,true]; //_agent setVariable ["doLoiter",true,true];
_agent setDir round(random 180); } else {
_agent setVariable ["doLoiter",false,true];
}; };
dayz_spawnZombies = dayz_spawnZombies + 1; dayz_spawnZombies = dayz_spawnZombies + 1;
//diag_log ("CREATE INFECTED: " + str(_this)); //diag_log ("CREATE INFECTED: " + str(_this));
//_position = getPosATL _agent; _position = getPosATL _agent;
//_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0; _nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
if (random 1 > 0.7) then { if (random 1 > 0.7) then {
_agent setUnitPos "Middle"; _agent setUnitPos "Middle";
@@ -51,24 +46,29 @@ if (random 1 > 0.7) then {
//diag_log ("CREATED: " + str(_agent)); //diag_log ("CREATED: " + str(_agent));
/*
//_agent setVariable["host",player,true]; //_agent setVariable["host",player,true];
if (!_doLoiter) then { if (!_doLoiter) then {
_agent setPosATL _position;
_agent setDir round(random 180); _agent setDir round(random 180);
_agent setVariable ["doLoiter",false,true];
if (_nearByPlayer) then { if (_nearByPlayer) then {
deleteVehicle _agent;
};
} else {
if (_nearByPlayer) then {
_attempt = 0;
while {_nearByPlayer} do { while {_nearByPlayer} do {
_position = [_position,40,80,10,0,20,0] call BIS_fnc_findSafePos; _position = [_position,0,20,10,0,20,0] call BIS_fnc_findSafePos;
_agent switchmove AidlPpneMstpSnonWnonDnon_SleepA_layDown; _agent setPos _position;
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
_attempt = _attempt + 1; _attempt = _attempt + 1;
if (_attempt > 10) exitWith {}; if (_attempt > 10) exitWith {};
} else {
_position = [_position,0,20,10,0,20,0] call BIS_fnc_findSafePos;
_agent setPosATL _position;
}; };
_agent setPos _position;
}; };
}; };
*/
if (isNull _agent) exitWith { if (isNull _agent) exitWith {
dayz_spawnZombies = dayz_spawnZombies - 1; dayz_spawnZombies = dayz_spawnZombies - 1;

View File

@@ -33,7 +33,7 @@ class CfgMods
hidePicture = 0; hidePicture = 0;
hideName = 0; hideName = 0;
action = "http://www.dayzmod.com"; action = "http://www.dayzmod.com";
version = "1.7.5.D1216"; version = "1.7.5.D1222";
hiveVersion = 0.96; //0.93 hiveVersion = 0.96; //0.93
}; };
}; };
@@ -406,6 +406,66 @@ class CfgBuildingLoot {
0.05 0.05
}; };
}; };
class HeliCrash_No50s: Default {
zombieChance = 0;
maxRoaming = 2;
zombieClass[] = {"z_soldier_pilot"};
lootChance = 0.5;
lootPos[] = {};
itemType[] = {
{"FN_FAL","weapon"},
{"bizon_silenced","weapon"},
{"M14_EP1","weapon"},
{"FN_FAL_ANPVS4","weapon"},
// {"M107_DZ","weapon"},
// {"BAF_AS50_scoped","weapon"},
{"Mk_48_DZ","weapon"},
{"M249_DZ","weapon"},
//{"BAF_L85A2_RIS_CWS","weapon"},
{"BAF_L85A2_RIS_Holo","weapon"},
{"DMR","weapon"},
{"","military"},
{"","medical"},
{"MedBox0","object"},
{"NVGoggles","weapon"},
{"AmmoBoxSmall_556","object"},
{"AmmoBoxSmall_762","object"},
{"Skin_Camo1_DZ","magazine"},
{"Skin_Sniper1_DZ","magazine"},
{"G36C","weapon"},
{"G36C_camo","weapon"},
//{"G36_C_SD_camo","weapon"},
{"G36A_camo","weapon"},
{"G36K_camo","weapon"},
{"100Rnd_762x54_PK","magazine"}
};
itemChance[] = {
0.02, //{"FN_FAL","weapon"},
0.05, //{"bizon_silenced","weapon"},
0.05, //{"M14_EP1","weapon"},
0.02, //{"FN_FAL_ANPVS4","weapon"},
// 0.02, //{"m107","weapon"},
// 0.01, //{"BAF_AS50_scoped","weapon"},
0.03, //{"Mk_48_DZ","weapon"},
0.05, //{"M249_DZ","weapon"},
0.01, //{"BAF_L85A2_RIS_CWS","weapon"}, BAF_L85A2_RIS_Holo
0.06, //{"DMR","weapon"},
1, //{"","military"},
0.5, //{"","medical"},
0.1, //{"MedBox0","object"},
0.02, //{"NVGoggles","weapon"}
0.1, //AmmoBoxSmall_556
0.1, //AmmoBoxSmall_762
0.08, //Skin_Camo1_DZ
0.05, //Skin_Sniper1_DZ
0.03, //G36C"
0.02, //G36C_camo
//0.01, //G36_C_SD_camo
0.02, //G36A_camo
0.02, //G36K_camo
0.01 //("100Rnd_762x54_PK","magazine"}
};
};
class Hospital: Default { class Hospital: Default {
zombieChance = 0.4; zombieChance = 0.4;
minRoaming = 2; minRoaming = 2;

View File

@@ -19,6 +19,7 @@ if (!isDedicated) then {
player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange
player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf"; player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf"; player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
player_spawnCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf";
player_spawnLootCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnlootCheck.sqf"; player_spawnLootCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnlootCheck.sqf";
player_spawnZedCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnzedCheck.sqf"; player_spawnZedCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnzedCheck.sqf";
building_spawnLoot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf"; building_spawnLoot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf";
@@ -49,7 +50,6 @@ if (!isDedicated) then {
player_throwObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_throwObject.sqf"; player_throwObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_throwObject.sqf";
player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf"; player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf"; player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
player_combatCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_combatCheck.sqf";
//Objects //Objects
object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf"; object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
@@ -60,6 +60,10 @@ if (!isDedicated) then {
zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour
zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour
//Wild
//wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf";
//
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf"; dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
// Vehicle damage fix // Vehicle damage fix

View File

@@ -1,4 +1,4 @@
private["_cfgCount","_i","_j","_k","_l","_config","_defaultCfg","_itemTypes","_itemChances","_itemCount","_weighted","_weight"]; private["_cfgCount","_config","_i","_itemChances","_itemCount","_weighted","_j","_weight","_l","_k","_type","_canZombie","_canLoot"];
dayz_CBLChances = []; dayz_CBLChances = [];
dayz_CBLCounts = []; dayz_CBLCounts = [];
@@ -41,3 +41,22 @@ for "_i" from 0 to ((count (_config)) - 1) do {
dayz_CLBase set [count dayz_CLBase, configName (_config select _i)]; dayz_CLBase set [count dayz_CLBase, configName (_config select _i)];
dayz_CLChances set [count dayz_CLChances, _weighted]; dayz_CLChances set [count dayz_CLChances, _weighted];
}; };
private["_i","_type","_config","_canZombie","_canLoot"];
dayz_ZombieBuildings = [];
dayz_LootBuildings = [];
for "_i" from 0 to (count (configFile >> "CfgBuildingLoot") - 1) do {
_type = (configFile >> "CfgBuildingLoot") select _i;
_canZombie = getNumber (_type >> "zombieChance") > 0;
_canLoot = getNumber (_type >> "lootChance") > 0;
if(_canZombie) then {
if(!((configName _type) in dayz_ZombieBuildings)) then {
dayz_ZombieBuildings set [count dayz_ZombieBuildings, configName _type];
};
};
if(_canLoot) then {
if(!((configName _type) in dayz_LootBuildings)) then {
dayz_LootBuildings set [count dayz_LootBuildings, configName _type];
};
};
};

View File

@@ -230,11 +230,7 @@ dayz_maxAnimals = 5;
DAYZ_agentnumber = 0; DAYZ_agentnumber = 0;
dayz_animalDistance = 800; dayz_animalDistance = 800;
dayz_zSpawnDistance = 1000; dayz_zSpawnDistance = 1000;
dayz_maxLocalZombies = 40;
if(isnil "dayz_maxLocalZombies") then {
dayz_maxLocalZombies = 40;
};
dayz_spawnPos = getPosATL player; dayz_spawnPos = getPosATL player;
//init global arrays for Loot Chances //init global arrays for Loot Chances

View File

@@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version class DAYZ_Version : CA_Version
{ {
idc = -1; idc = -1;
text = "DayZ 1.7.5.D1216"; text = "DayZ 1.7.5.D1222";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)"; y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
}; };
class CA_TitleMainMenu; class CA_TitleMainMenu;

View File

@@ -1,4 +1,4 @@
/*%FSM<COMPILE "F:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Player Monitor">*/ /*%FSM<COMPILE "D:\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Player Monitor">*/
/*%FSM<HEAD>*/ /*%FSM<HEAD>*/
/* /*
item0[] = {"init",0,250,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"init"}; item0[] = {"init",0,250,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"init"};
@@ -36,7 +36,7 @@ item31[] = {"ERROR__Bad_Versi",2,250,175.000000,650.000000,275.000000,700.000000
item32[] = {"Display_Ready",4,218,-175.000000,900.000000,-75.000000,950.000000,0.000000,"Display" \n "Ready"}; item32[] = {"Display_Ready",4,218,-175.000000,900.000000,-75.000000,950.000000,0.000000,"Display" \n "Ready"};
item33[] = {"Preload_Display",2,250,-75.000000,950.000000,25.000000,1000.000000,0.000000,"Preload" \n "Display"}; item33[] = {"Preload_Display",2,250,-75.000000,950.000000,25.000000,1000.000000,0.000000,"Preload" \n "Display"};
item34[] = {"Preload_Done",4,218,-175.000000,1000.000000,-75.000000,1050.000000,0.000000,"Preload" \n "Done"}; item34[] = {"Preload_Done",4,218,-175.000000,1000.000000,-75.000000,1050.000000,0.000000,"Preload" \n "Done"};
item35[] = {"Initialize",2,250,-75.000000,1050.000000,25.000000,1100.000000,0.000000,"Initialize"}; item35[] = {"Initialize",2,4346,-75.000000,1050.000000,25.000000,1100.000000,0.000000,"Initialize"};
item36[] = {"Finish",1,250,-75.000000,1150.000000,25.000000,1200.000000,0.000000,"Finish"}; item36[] = {"Finish",1,250,-75.000000,1150.000000,25.000000,1200.000000,0.000000,"Finish"};
item37[] = {"True",8,218,25.000000,1100.000000,125.000000,1150.000000,0.000000,"True"}; item37[] = {"True",8,218,25.000000,1100.000000,125.000000,1150.000000,0.000000,"True"};
item38[] = {"Too_Long",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"Too" \n "Long"}; item38[] = {"Too_Long",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"Too" \n "Long"};
@@ -1101,14 +1101,14 @@ class FSM
"" \n "" \n
"dayz_lootCheck = [] spawn {" \n "dayz_lootCheck = [] spawn {" \n
" while {true} do {" \n " while {true} do {" \n
" call player_spawnLootCheck;" \n " [""Loot""] call player_spawnCheck;" \n
" sleep 10;" \n " sleep 10;" \n
" };" \n " };" \n
"};" \n "};" \n
"dayz_zedCheck = [] spawn {" \n "dayz_zedCheck = [] spawn {" \n
" while {true} do {" \n " while {true} do {" \n
" call player_spawnZedCheck; " \n " [""Zeds""] call player_spawnCheck; " \n
" sleep 7;" \n " sleep 8;" \n
" };" \n " };" \n
"};" \n "};" \n
"dayz_locationCheck = [] spawn {" \n "dayz_locationCheck = [] spawn {" \n
@@ -1117,12 +1117,6 @@ class FSM
" sleep 2;" \n " sleep 2;" \n
" };" \n " };" \n
"};" \n "};" \n
"dayz_combatCheck = [] spawn {" \n
" while {true} do {" \n
" call player_combatCheck;" \n
" sleep 5;" \n
" };" \n
"};" \n
"// TODO: questionably" \n "// TODO: questionably" \n
"{ _x call fnc_vehicleEventHandler; } forEach vehicles;" \n "{ _x call fnc_vehicleEventHandler; } forEach vehicles;" \n
"" \n "" \n

View File

@@ -14,7 +14,7 @@ item9[] = {"true",8,218,-300.000000,-175.000000,-200.000000,-125.000000,0.000000
item10[] = {"Begin",2,250,-300.000000,-100.000000,-200.000000,-50.000000,0.000000,"Begin"}; item10[] = {"Begin",2,250,-300.000000,-100.000000,-200.000000,-50.000000,0.000000,"Begin"};
item11[] = {"",7,210,-254.000046,-29.000004,-245.999954,-20.999996,0.000000,""}; item11[] = {"",7,210,-254.000046,-29.000004,-245.999954,-20.999996,0.000000,""};
item12[] = {"",7,210,-204.000046,146.000000,-195.999954,154.000000,0.000000,""}; item12[] = {"",7,210,-204.000046,146.000000,-195.999954,154.000000,0.000000,""};
item13[] = {"Has_Target",4,218,-150.000000,225.000000,-50.000000,275.000000,1.000000,"Has" \n "Target"}; item13[] = {"Has_Target",4,4314,-150.000000,225.000000,-50.000000,275.000000,1.000000,"Has" \n "Target"};
item14[] = {"Chase",2,250,-150.000000,300.000000,-50.000000,350.000000,0.000000,"Chase"}; item14[] = {"Chase",2,250,-150.000000,300.000000,-50.000000,350.000000,0.000000,"Chase"};
item15[] = {"",7,210,-29.000006,146.000000,-20.999996,154.000000,0.000000,""}; item15[] = {"",7,210,-29.000006,146.000000,-20.999996,154.000000,0.000000,""};
item16[] = {"",7,210,-29.000006,196.000000,-20.999996,204.000000,0.000000,""}; item16[] = {"",7,210,-29.000006,196.000000,-20.999996,204.000000,0.000000,""};
@@ -46,8 +46,8 @@ item41[] = {"",7,210,221.000000,-79.000000,229.000000,-71.000000,0.000000,""};
item42[] = {"too_long",4,218,-425.000000,600.000000,-325.000000,650.000000,0.000000,"too long"}; item42[] = {"too_long",4,218,-425.000000,600.000000,-325.000000,650.000000,0.000000,"too long"};
item43[] = {"",7,210,-229.000000,621.000000,-221.000000,629.000000,0.000000,""}; item43[] = {"",7,210,-229.000000,621.000000,-221.000000,629.000000,0.000000,""};
item44[] = {"",7,210,-479.000000,621.000000,-471.000000,629.000000,0.000000,""}; item44[] = {"",7,210,-479.000000,621.000000,-471.000000,629.000000,0.000000,""};
item45[] = {"Reset_Targeting",2,4346,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"}; item45[] = {"Reset_Targeting",2,250,-525.000000,325.000000,-425.000000,375.000000,0.000000,"Reset" \n "Targeting"};
item46[] = {"true",8,218,-525.000000,250.000000,-425.000000,300.000000,0.000000,"true"}; item46[] = {"No_target",4,218,-525.000000,250.000000,-425.000000,300.000000,0.000000,"No target"};
item47[] = {"deleted",4,218,425.000000,-25.000000,525.000000,25.000000,0.000000,"deleted"}; item47[] = {"deleted",4,218,425.000000,-25.000000,525.000000,25.000000,0.000000,"deleted"};
item48[] = {"",7,210,471.000000,-79.000000,479.000000,-71.000000,0.000000,""}; item48[] = {"",7,210,471.000000,-79.000000,479.000000,-71.000000,0.000000,""};
item49[] = {"",7,210,471.000000,95.999977,479.000000,104.000023,0.000000,""}; item49[] = {"",7,210,471.000000,95.999977,479.000000,104.000023,0.000000,""};
@@ -122,8 +122,8 @@ link64[] = {49,47};
link65[] = {50,28}; link65[] = {50,28};
link66[] = {51,5}; link66[] = {51,5};
link67[] = {52,1}; link67[] = {52,1};
globals[] = {25.000000,1,0,0,0,640,480,1,99,6316128,1,-558.318542,127.785744,629.057495,-6.630199,626,580,1}; globals[] = {25.000000,1,0,0,0,640,480,1,99,6316128,1,-558.318542,127.785744,597.327209,-38.360462,626,580,1};
window[] = {0,-1,-1,-32000,-32000,712,46,1254,1,1,643}; window[] = {0,-1,-1,-1,-1,755,44,1252,44,1,643};
*//*%FSM</HEAD>*/ *//*%FSM</HEAD>*/
class FSM class FSM
{ {
@@ -249,6 +249,12 @@ class FSM
"if (!_hasMoved) then {" \n "if (!_hasMoved) then {" \n
" _agent setVariable[""doLoiter"",true,true];" \n " _agent setVariable[""doLoiter"",true,true];" \n
"};" \n "};" \n
"if (!moveToCompleted _agent) then {" \n
" _agent moveTo (position _agent);" \n
"};" \n
"" \n
"//Enable combat timer." \n
"_target setVariable[""startcombattimer"", 1, true];" \n
"" \n "" \n
"_countr = 0;" \n "_countr = 0;" \n
"_losCheck = 0;" \n "_losCheck = 0;" \n
@@ -560,7 +566,10 @@ class FSM
class Reset_Targeting class Reset_Targeting
{ {
name = "Reset_Targeting"; name = "Reset_Targeting";
init = /*%FSM<STATEINIT""">*/"if (!isNull _target) then {" \n init = /*%FSM<STATEINIT""">*/"_isAlive = alive _agent;" \n
"_target = _agent call zombie_findTargetAgent;" \n
"" \n
"if (!isNull _target) then {" \n
" _targetPos = getPosATL _target;" \n " _targetPos = getPosATL _target;" \n
" _agent setVariable [""myDest"",_targetPos];" \n " _agent setVariable [""myDest"",_targetPos];" \n
" _agent moveTo _targetPos;" \n " _agent moveTo _targetPos;" \n
@@ -586,19 +595,25 @@ class FSM
"if (!_hasMoved) then {" \n "if (!_hasMoved) then {" \n
" _agent setVariable[""doLoiter"",true,true];" \n " _agent setVariable[""doLoiter"",true,true];" \n
"};" \n "};" \n
"if (!moveToCompleted _agent) then {" \n
" _agent moveTo (position _agent);" \n
"};" \n
"" \n
"//Enable combat timer." \n
"_target setVariable[""startcombattimer"", 1, true];" \n
"" \n "" \n
"_countr = 0;" \n "_countr = 0;" \n
"_losCheck = 0;" \n "_losCheck = 0;" \n
"_cantSee = false;"/*%FSM</ACTION""">*/; "_cantSee = false;"/*%FSM</ACTION""">*/;
}; };
/*%FSM</LINK>*/ /*%FSM</LINK>*/
/*%FSM<LINK "true">*/ /*%FSM<LINK "No_target">*/
class true class No_target
{ {
priority = 0.000000; priority = 0.000000;
to="Loiter"; to="Loiter";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/; condition=/*%FSM<CONDITION""">*/"(isNull _target)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/; action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
}; };
/*%FSM</LINK>*/ /*%FSM</LINK>*/

View File

@@ -22,7 +22,7 @@ if ((_timeout - time) > 0) then {
}; };
diag_log format["DISCONNECT: %1 (%2) Object: %3, _characterID: %4", _playerName,_playerID,_object,_characterID]; diag_log format["DISCONNECT: %1 (%2) Object: %3, _characterID: %4", _playerName,_playerID,_object,_characterID];
_id = [_playerID,_characterID,2] spawn dayz_recordLogin;
dayz_disco = dayz_disco - [_playerID]; dayz_disco = dayz_disco - [_playerID];
if (!isNull _object) then { if (!isNull _object) then {
//Update Vehicle //Update Vehicle
@@ -30,7 +30,6 @@ if (!isNull _object) then {
(nearestObjects [getPosATL _object, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage"], 10]); (nearestObjects [getPosATL _object, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage", "VaultStorage"], 10]);
if (alive _object) then { if (alive _object) then {
[_object,[],true] call server_playerSync; [_object,[],true] call server_playerSync;
_id = [_playerID,_characterID,2] spawn dayz_recordLogin;
_myGroup = group _object; _myGroup = group _object;
deleteVehicle _object; deleteVehicle _object;
deleteGroup _myGroup; deleteGroup _myGroup;

View File

@@ -2,27 +2,38 @@ private["_position","_num","_config","_itemType","_itemChance","_weights","_inde
waitUntil{!isNil "BIS_fnc_selectRandom"}; waitUntil{!isNil "BIS_fnc_selectRandom"};
_crashModel = _this select 0; //_crashModel = _this select 0;
_lootTable = _this select 1; //_lootTable = _this select 1;
_guaranteedLoot = _this select 2; _guaranteedLoot = _this select 0;
_randomizedLoot = _this select 3; _randomizedLoot = _this select 1;
_frequency = _this select 4; _frequency = _this select 2;
_variance = _this select 5; _variance = _this select 3;
_spawnChance = _this select 6; _spawnChance = _this select 4;
_spawnMarker = _this select 7; _spawnMarker = _this select 5;
_spawnRadius = _this select 8; _spawnRadius = _this select 6;
_spawnFire = _this select 9; _spawnFire = _this select 7;
_fadeFire = _this select 10; _fadeFire = _this select 8;
_crashName = getText (configFile >> "CfgVehicles" >> _crashModel >> "displayName");
diag_log(format["CRASHSPAWNER: Starting spawn logic for '%1' with loot table '%2'", _crashName, _lootTable]); diag_log("CRASHSPAWNER: Starting spawn logic for Crash Spawner");
while {true} do { while {true} do {
private["_timeAdjust","_timeToSpawn","_spawnRoll","_crash","_hasAdjustment","_newHeight","_adjustedPos"]; private["_timeAdjust","_timeToSpawn","_spawnRoll","_crash","_hasAdjustment","_newHeight","_adjustedPos"];
// Allows the variance to act as +/- from the spawn frequency timer // Allows the variance to act as +/- from the spawn frequency timer
_timeAdjust = round(random(_variance * 2) - _variance); _timeAdjust = round(random(_variance * 2) - _variance);
_timeToSpawn = time + _frequency + _timeAdjust; _timeToSpawn = time + _frequency + _timeAdjust;
//Adding some Random systems
_crashModel = ["UH60Wreck_DZ","UH1Wreck_DZ"] call BIS_fnc_selectRandom;
//Crash loot just uncomment the one you wish to use by default with 50cals is enabled.
//Table including 50 cals
_lootTable = ["Military","HeliCrash","MilitarySpecial"] call BIS_fnc_selectRandom;
//Table without 50 cals
//_lootTable = ["Military","HeliCrash_No50s","MilitarySpecial"] call BIS_fnc_selectRandom;
_crashName = getText (configFile >> "CfgVehicles" >> _crashModel >> "displayName");
diag_log(format["CRASHSPAWNER: %1%2 chance to spawn '%3' with loot table '%4' at %5", round(_spawnChance * 100), '%', _crashName, _lootTable, _timeToSpawn]); diag_log(format["CRASHSPAWNER: %1%2 chance to spawn '%3' with loot table '%4' at %5", round(_spawnChance * 100), '%', _crashName, _lootTable, _timeToSpawn]);
@@ -41,6 +52,16 @@ while {true} do {
diag_log(format["CRASHSPAWNER: Spawning '%1' with loot table '%2' NOW! (%3) at: %4", _crashName, _lootTable, time, str(_position)]); 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"]; _crash = createVehicle [_crashModel,_position, [], 0, "CAN_COLLIDE"];
deleteMarker "Secure Helicopter Wreck";
///Add crash site markers
_crashmarker = createMarker["Secure Helicopter Wreck",_position];
_crashmarker setMarkerColor "ColorRed";
_crashmarker setMarkerType "Flag";
//_crashmarker setMarkerShape "ELLIPSE";
//_crashmarker setMarkerBrush "Grid";
_crashmarker setMarkerText "Secure Helicopter";
_crashmarker setMarkerSize [1, 1];
// Randomize the direction the wreck is facing // Randomize the direction the wreck is facing
_crash setDir round(random 360); _crash setDir round(random 360);
@@ -100,7 +121,5 @@ while {true} do {
} forEach _nearBy; } forEach _nearBy;
}; };
} else {
diag_log(format["CRASHSPAWNER: Roll chance to spawn '%1' with loot table '%2' failed", _crashName, _lootTable]);
}; };
}; };

View File

@@ -231,18 +231,10 @@ for "_x" from 1 to MaxDynamicDebris do {
//waitUntil{scriptDone _id}; //waitUntil{scriptDone _id};
}; };
//Spawn crashed helos
//for "_x" from 1 to MaxHeliCrashes do {
//_id = [] spawn spawn_heliCrash;
//waitUntil{scriptDone _id};
//};
// Allow connection after road debris spawns
allowConnection = true; allowConnection = true;
_randomcrashmodel = ["UH60Wreck_DZ","UH1Wreck_DZ","UH60Wreck_DZ","UH1Wreck_DZ"] call BIS_fnc_selectRandom;
_randomcrashloot = ["Military","HeliCrash","MilitarySpecial","Military","HeliCrash","MilitarySpecial"] call BIS_fnc_selectRandom; // [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
// [_crashModel, _lootTable, _guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire] nul = [3, 4, (50 * 60), (15 * 60), 0.75, 'center', 4000, true, false] spawn server_spawnCrashSite;
nul = [_randomcrashmodel, _randomcrashloot, 3, 4, (50 * 60), (15 * 60), 0.75, 'center', 4000, true, false] spawn server_spawnCrashSite;