mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
0.9 + pre 1.7.5
This commit is contained in:
@@ -196,9 +196,6 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
|
||||
r_player_actions set [count r_player_actions,_action];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
if (r_action) then {
|
||||
r_action_targets = r_action_targets + [_unit];
|
||||
};
|
||||
|
||||
@@ -19,6 +19,9 @@ _hasmuttonRaw = "FoodmuttonRaw" in magazines player;
|
||||
_haschickenRaw = "FoodchickenRaw" in magazines player;
|
||||
_hasrabbitRaw = "FoodrabbitRaw" in magazines player;
|
||||
_hasbaconRaw = "FoodbaconRaw" in magazines player;
|
||||
//boiled Water
|
||||
_hasbottleitem = "ItemWaterbottle" in magazines player;
|
||||
_hastinitem = ("TrashTinCan" in magazines player) or ("ItemSodaEmpty" in magazines player);
|
||||
//Define all Raw food
|
||||
_hasRawMeat = _hasSteakRaw or _hasmuttonRaw or _haschickenRaw or _hasrabbitRaw or _hasbaconRaw;
|
||||
|
||||
@@ -69,6 +72,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
||||
_isMan = cursorTarget isKindOf "Man";
|
||||
_traderType = typeOf cursorTarget;
|
||||
_ownerID = cursorTarget getVariable ["characterID","0"];
|
||||
diag_log ("owner = " + str(_ownerID) + " of " + str(cursorTarget));
|
||||
_isAnimal = cursorTarget isKindOf "Animal";
|
||||
_isDog = (cursorTarget isKindOf "DZ_Pastor" || cursorTarget isKindOf "DZ_Fin");
|
||||
_isZombie = cursorTarget isKindOf "zZombie_base";
|
||||
@@ -78,6 +82,15 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
||||
_isAlive = alive cursorTarget;
|
||||
_canmove = canmove cursorTarget;
|
||||
_text = getText (configFile >> "CfgVehicles" >> typeOf cursorTarget >> "displayName");
|
||||
|
||||
_rawmeat = meatraw;
|
||||
_hasRawMeat = false;
|
||||
{
|
||||
if (_x in magazines player) then {
|
||||
_hasRawMeat = true;
|
||||
};
|
||||
} forEach _rawmeat;
|
||||
|
||||
if (_hasFuelE) then {
|
||||
_isFuel = (cursorTarget isKindOf "Land_Ind_TankSmall") or (cursorTarget isKindOf "Land_fuel_tank_big") or (cursorTarget isKindOf "Land_fuel_tank_stairs") or (cursorTarget isKindOf "Land_fuel_tank_stairs_ep1") or (cursorTarget isKindOf "Land_wagon_tanker") or (cursorTarget isKindOf "Land_fuelstation") or (cursorTarget isKindOf "Land_fuelstation_army");
|
||||
};
|
||||
@@ -171,7 +184,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
||||
};
|
||||
};
|
||||
//Fireplace Actions check
|
||||
if(inflamed cursorTarget and (_hasSteakRaw or _hasmuttonRaw or _haschickenRaw or _hasrabbitRaw or _hasbaconRaw) and _canDo) then {
|
||||
if(inflamed _cursor and _hasRawMeat and _canDo) then {
|
||||
if (s_player_cook < 0) then {
|
||||
s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",cursorTarget, 3, true, true, "", ""];
|
||||
};
|
||||
@@ -179,6 +192,15 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
||||
player removeAction s_player_cook;
|
||||
s_player_cook = -1;
|
||||
};
|
||||
if(inflamed _cursor and (_hasbottleitem and _hastinitem) and _canDo) then {
|
||||
if (s_player_boil < 0) then {
|
||||
s_player_boil = player addAction [localize "str_actions_boilwater", "\z\addons\dayz_code\actions\boil.sqf",_cursor, 3, true, true, "", ""];
|
||||
};
|
||||
} else {
|
||||
player removeAction s_player_boil;
|
||||
s_player_boil = -1;
|
||||
};
|
||||
|
||||
if(cursorTarget == dayz_hasFire and _canDo) then {
|
||||
if ((s_player_fireout < 0) and !(inflamed cursorTarget) and (player distance cursorTarget < 3)) then {
|
||||
s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",cursorTarget, 0, false, true, "",""];
|
||||
@@ -407,13 +429,13 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
||||
|
||||
dayz_myCursorTarget = objNull;
|
||||
|
||||
{player removeAction _x} forEach s_player_madsci;s_player_madsci = [];
|
||||
//{player removeAction _x} forEach s_player_madsci;s_player_madsci = [];
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
|
||||
//{player removeAction _x} forEach s_player_bank;s_player_bank = [];
|
||||
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
|
||||
|
||||
s_player_madsci_crtl = -1;
|
||||
//s_player_madsci_crtl = -1;
|
||||
s_player_parts_crtl = -1;
|
||||
s_last_trader = -1;
|
||||
|
||||
@@ -436,6 +458,8 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
||||
s_player_butcher = -1;
|
||||
player removeAction s_player_cook;
|
||||
s_player_cook = -1;
|
||||
player removeAction s_player_boil;
|
||||
s_player_boil = -1;
|
||||
player removeAction s_player_fireout;
|
||||
s_player_fireout = -1;
|
||||
player removeAction s_player_packtent;
|
||||
|
||||
33
dayz_code/compile/fnc_MapEventHandler.sqf
Normal file
33
dayz_code/compile/fnc_MapEventHandler.sqf
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
if ("ItemMap_Debug" in items player) then {
|
||||
_world = toUpper(worldName);
|
||||
_maptype = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
|
||||
_config = configFile >> "CfgWorlds" >> worldName >> "Names";
|
||||
|
||||
for "_i" from 0 to (count _config -1) do {
|
||||
_class = _config select _i; //Returns a conif
|
||||
_name = getText (_class >> "name");
|
||||
_type = getText (_class >> "type");
|
||||
_position = getArray (_class >> "position");
|
||||
_radiusA = getNumber (_class >> "radiusA");
|
||||
_radiusB = getNumber (_class >> "radiusB");
|
||||
|
||||
|
||||
if (_type in _maptype) then {
|
||||
diag_log(format["Config Type, Name: %1 / Type: %2 / Position: %3, Passed",_name,_type,_position]);
|
||||
// _rnd = random 1;
|
||||
// _chance = 0.6;
|
||||
// if (_rnd < _chance) then {
|
||||
_markerstr = createMarkerLocal ["markername_" +str (_name), _position];
|
||||
_markerstr setMarkerTextLocal _name;
|
||||
_markerstr setMarkerColorLocal "ColorGreen";
|
||||
_markerstr setMarkerShapeLocal "ELLIPSE";
|
||||
_markerstr setMarkerBrushLocal "Grid";
|
||||
_markerstr setMarkerSizeLocal [_radiusA, _radiusB];
|
||||
// };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@ private["_display","_btnRespawn","_btnAbort","_timeOut","_timeMax","_isDead"];
|
||||
_isDead = !alive player;
|
||||
|
||||
if(r_fracture_legs) exitWith {_btnRespawn ctrlEnable true;};
|
||||
if(_isDead) exitwith {_btnAbort ctrlEnable true;};
|
||||
|
||||
sleep 1;
|
||||
while {!isNull _display} do {
|
||||
switch true do {
|
||||
case ({isPlayer _x} count (player nearEntities ["AllVehicles", 6]) > 1) : {
|
||||
|
||||
76
dayz_code/compile/wild_spawnZombies.sqf
Normal file
76
dayz_code/compile/wild_spawnZombies.sqf
Normal file
@@ -0,0 +1,76 @@
|
||||
private["_position","_doLoiter","_unitTypes","_isNoone","_loot","_array","_agent","_type","_radius","_method","_nearByPlayer","_attempt","_myDest","_newDest","_lootType"];
|
||||
_position = _this select 0;
|
||||
_maxZombies = _this select 1;
|
||||
|
||||
_totalzeds = dayz_spawnZombies;
|
||||
|
||||
diag_log ("totalzeds" +str"_totalzeds");
|
||||
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
||||
_doLoiter = true;
|
||||
|
||||
_loot = "";
|
||||
_array = [];
|
||||
_agent = objNull;
|
||||
|
||||
_type = _unitTypes call BIS_fnc_selectRandom;
|
||||
|
||||
diag_log ("Wild Loaded");
|
||||
|
||||
//Create the Group and populate it
|
||||
//diag_log ("Spawned: " + _type);
|
||||
_radius = 40;
|
||||
_method = "NONE";
|
||||
|
||||
_nearByPlayer = ({isPlayer _x} count (_position nearEntities ["CAManBase",30])) > 0;
|
||||
|
||||
if (_nearByPlayer) then {
|
||||
_position = [_position,55,100,10,0,0,0] call BIS_fnc_findSafePos;
|
||||
};
|
||||
_agent = createAgent [_type, _position, [], _radius, _method];
|
||||
|
||||
if (_doLoiter) then {
|
||||
//_agent setPosATL _position;
|
||||
//_agent setVariable ["doLoiter",true,true];
|
||||
_agent setDir round(random 180);
|
||||
};
|
||||
|
||||
|
||||
dayz_spawnZombies = dayz_spawnZombies + 1;
|
||||
|
||||
if (random 1 > 0.7) then {
|
||||
_agent setUnitPos "Middle";
|
||||
};
|
||||
|
||||
//diag_log ("CREATED: " + str(_agent));
|
||||
|
||||
|
||||
if (isNull _agent) exitWith {
|
||||
dayz_spawnZombies = dayz_spawnZombies - 1;
|
||||
};
|
||||
|
||||
_isAlive = alive _agent;
|
||||
|
||||
_myDest = getPosATL _agent;
|
||||
_newDest = getPosATL _agent;
|
||||
_agent setVariable ["myDest",_myDest];
|
||||
_agent setVariable ["newDest",_newDest];
|
||||
|
||||
//Add some loot
|
||||
_rnd = random 1;
|
||||
if (_rnd > 0.3) then {
|
||||
_lootType = configFile >> "CfgVehicles" >> _type >> "zombieLoot";
|
||||
if (isText _lootType) then {
|
||||
_array = []+ getArray (configFile >> "cfgLoot" >> getText(_lootType));
|
||||
if (count _array > 0) then {
|
||||
_loot = _array call BIS_fnc_selectRandomWeighted;
|
||||
if(!isNil "_array") then {
|
||||
_agent addMagazine _loot;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Start behavior
|
||||
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
|
||||
|
||||
diag_log ("Wild Ended");
|
||||
@@ -9,7 +9,7 @@ _array = [];
|
||||
_agent = objNull;
|
||||
|
||||
//Exit if a player is nearby
|
||||
if (!isNoone) exitWith {};
|
||||
if (!_isNoone) exitWith {};
|
||||
|
||||
if (count _unitTypes == 0) then {
|
||||
_unitTypes = []+ getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
||||
|
||||
Reference in New Issue
Block a user