mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-24 17:39:18 +03:00
+ Crafting now only requires a fire within 2m. + Safe should now drop items on ground when packed. + Changed humanity gains/losses based on player death so that humanity is accounted for. + Fixed broken humanity hit and freetarget with player damage since 1.7.6.1. + Potential fix for swimming in ground. + !isNull and Distance checks for player zombie "feed" option. + Added open crate option for supply crates. Requires crowbar in toolbelt.
56 lines
1.5 KiB
Plaintext
56 lines
1.5 KiB
Plaintext
private ["_dir","_classname","_box","_location","_item","_config","_create_raw","_create","_qty","_type","_hasCrate","_hasTool"];
|
|
|
|
if(TradeInprogress) exitWith { cutText ["Repair already in progress." , "PLAIN DOWN"]; };
|
|
TradeInprogress = true;
|
|
|
|
_hasTool = "ItemCrowbar" in items player;
|
|
if(!_hasTool) exitWith {
|
|
cutText ["You need a crowbar to open this.", "PLAIN DOWN"];
|
|
TradeInprogress = false;
|
|
};
|
|
|
|
_item = _this;
|
|
_hasCrate = _item in magazines player;
|
|
if (!_hasCrate) then {
|
|
cutText ["Missing supply crate.", "PLAIN DOWN"];
|
|
TradeInprogress = false;
|
|
};
|
|
|
|
_config = configFile >> "CfgMagazines" >> _item;
|
|
_create_raw = getArray (_config >> "ItemActions" >> "CreateMags" >> "output");
|
|
_create = _create_raw select 0;
|
|
_qty = _create_raw select 1;
|
|
_type = _create_raw select 2;
|
|
|
|
_location = player modeltoworld [0,0.3,0];
|
|
if ((_location select 2) < 0) then {
|
|
_location set [2,0];
|
|
};
|
|
|
|
player removeMagazine _item;
|
|
_dir = getDir player;
|
|
_classname = "CardboardBox";
|
|
|
|
// Change to optional wait to complete
|
|
player playActionNow "Medic";
|
|
sleep 6;
|
|
|
|
_box = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
|
_box setDir _dir;
|
|
|
|
// Fill box with Items from config.
|
|
if(_type == "magazine") then {
|
|
_box addMagazineCargoGlobal [_create,_qty];
|
|
};
|
|
if(_type == "weapon") then {
|
|
_box addWeaponCargoGlobal [_create,_qty];
|
|
};
|
|
if(_type == "backpack") then {
|
|
_box addBackpackCargoGlobal [_create,_qty];
|
|
};
|
|
|
|
player reveal _box;
|
|
|
|
cutText ["Opened supply crate.", "PLAIN DOWN"];
|
|
|
|
TradeInprogress = false; |