mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-17 09:10:27 +03:00
+ Fixed females unable to select gender after death. + Fixed Alice and Assault packs inventory issues created with last patch. + Fixed being unable to take items that may have already been claimed by another player. Should work if no other players are within 6 meters. + Cooking, Crafting, Repairing, and Salvaging all now require full Medic animation cycle to complete. You can cancel the process just by moving. + Traders that deal with magazine items now require full Medic animation cycle per trade. Also, number of possible trades now based on quantity of available items being sold or cost divided by available bars. + Changed several PublicVariable calls from 1.7.6.1 code sync that should have been PublicVariableServer. + Fixed Bio-meat was not causing infection and increased chance of infection from "Bad Food" to 50/50. + Added distance checks (5m) for player zombie attacks. + Fixed player zombie was unable to feed.
79 lines
1.9 KiB
Plaintext
79 lines
1.9 KiB
Plaintext
private["_config","_item","_text","_rawmeat","_cookedmeat","_meat","_meatcooked","_qty","_id"];
|
|
|
|
if(TradeInprogress) exitWith { cutText ["Cooking already in progress." , "PLAIN DOWN"]; };
|
|
TradeInprogress = true;
|
|
|
|
// diag_log ("Cook Enabled");
|
|
player removeAction s_player_cook;
|
|
s_player_cook = -1;
|
|
|
|
_rawmeat = meatraw;
|
|
_cookedmeat = meatcooked;
|
|
|
|
|
|
|
|
{
|
|
_meat = _x;
|
|
_meatcooked = _cookedmeat select (_rawmeat find _meat);
|
|
_removed = 0;
|
|
if (_meat in magazines player) then {
|
|
_text = getText (configFile >> "CfgMagazines" >> _meatcooked >> "displayName");
|
|
cutText [format["Started cooking %1 of %2",_qty,_text], "PLAIN DOWN"];
|
|
|
|
_qty = {_x == _meat} count magazines player;
|
|
|
|
player playActionNow "Medic";
|
|
|
|
_dis=6;
|
|
_sfx = "cook";
|
|
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
|
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
|
|
|
r_interrupt = false;
|
|
_animState = animationState player;
|
|
r_doLoop = true;
|
|
_started = false;
|
|
_finished = false;
|
|
|
|
while {r_doLoop} do {
|
|
_animState = animationState player;
|
|
_isMedic = ["medic",_animState] call fnc_inString;
|
|
if (_isMedic) then {
|
|
_started = true;
|
|
};
|
|
if (_started and !_isMedic) then {
|
|
r_doLoop = false;
|
|
_finished = true;
|
|
};
|
|
if (r_interrupt) then {
|
|
r_doLoop = false;
|
|
};
|
|
sleep 0.1;
|
|
};
|
|
r_doLoop = false;
|
|
|
|
|
|
if (_finished) then {
|
|
|
|
_removed = _removed + ([player,_meat,_qty] call BIS_fnc_invRemove);
|
|
|
|
// Add only number of items removed
|
|
for "_x" from 1 to _removed do {
|
|
player addMagazine _meatcooked;
|
|
};
|
|
|
|
cutText [format[(localize "str_success_cooked"),_qty,_text], "PLAIN DOWN"];
|
|
|
|
} else {
|
|
r_interrupt = false;
|
|
[objNull, player, rSwitchMove,""] call RE;
|
|
player playActionNow "stop";
|
|
|
|
cutText [format["Canceled cooking %1 of %2",_qty,_text], "PLAIN DOWN"];
|
|
|
|
// player addMagazine "ItemBandage";
|
|
};
|
|
};
|
|
} forEach _rawmeat;
|
|
|
|
TradeInprogress = false; |