mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-24 00:50:50 +03:00
Move old files
This commit is contained in:
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
Created by Alby exclusively for DayZMod.
|
||||
Please request permission to use/alter from Alby.
|
||||
*/
|
||||
|
||||
private ["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace","_overwrite","_orignalClass","_index","_entry","_avail","_selection","_item","_amount","_itemName","_freeSlots","_slotType","_i","_j"];
|
||||
disableSerialization;
|
||||
["close"] call fn_updateCraftUI;
|
||||
|
||||
_config = _this select 0;
|
||||
_overwrite = _this select 1;
|
||||
_input = getArray (_config >> "input");
|
||||
_required = getArray (_config >> "toolsRequired");
|
||||
_orignalClass = getText (_config >> "orignalclass");
|
||||
|
||||
|
||||
//diag_log (str(_this));
|
||||
|
||||
if (count _overwrite > 0) then {
|
||||
{
|
||||
_index = _x select 0;
|
||||
_entry = _x select 1;
|
||||
_input set [_index, _entry];
|
||||
}forEach _overwrite;
|
||||
};
|
||||
|
||||
//done from player inventory
|
||||
_hasInput = true;
|
||||
{
|
||||
private ["_avail"];
|
||||
_selection = _x select 1;
|
||||
_item = _x select 0;
|
||||
_amount = _x select 2;
|
||||
|
||||
switch (_selection) do {
|
||||
case "CfgWeapons":
|
||||
{
|
||||
_avail = {_x == _item} count weapons player;
|
||||
};
|
||||
case "CfgMagazines":
|
||||
{
|
||||
_avail = {_x == _item} count magazines player;
|
||||
};
|
||||
};
|
||||
|
||||
if (_avail < _amount) exitWith {
|
||||
_hasInput = false;
|
||||
_itemName = getText(configFile >> _selection >> _item >> "displayName");
|
||||
format[localize "str_crafting_missing",(_amount - _avail),_itemName] call dayz_rollingMessages;
|
||||
};
|
||||
} forEach (_input + _required);
|
||||
|
||||
if (_hasInput) then {
|
||||
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
|
||||
false call dz_fn_meleeMagazines;
|
||||
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
|
||||
{
|
||||
_item = _x select 0;
|
||||
_amount = _x select 2;
|
||||
_slotType = [_item] call BIS_fnc_invSlotType;
|
||||
for "_i" from 1 to _amount do {
|
||||
for "_j" from 1 to (count _slotType) do {
|
||||
if ((_slotType select _j) > 0) then {
|
||||
_freeSlots set[_j, ((_freeSlots select _j) + (_slotType select _j))];
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach _input;
|
||||
true call dz_fn_meleeMagazines;
|
||||
_availabeSpace = true;
|
||||
//uiSleep 1;
|
||||
|
||||
if (_availabeSpace) then {
|
||||
player playActionNow "PutDown";
|
||||
|
||||
//Hack to get craft menu to use build needs a good tidy up
|
||||
[_orignalClass,"Build","ItemActions"] spawn player_build;
|
||||
};
|
||||
};
|
||||
@@ -1,47 +0,0 @@
|
||||
//fixHatchet old file
|
||||
private ["_tool","_tape","_fixedItem","_config","_dName","_handle","_finished"];
|
||||
|
||||
_tool = _this;
|
||||
_config = configFile >> "CfgWeapons" >> _tool;
|
||||
_fixedItem = getText(_config >> "fixedTool");
|
||||
|
||||
_dName = getText(configFile >> "CfgWeapons" >> _fixedItem >> "displayName");
|
||||
|
||||
//Used for Grip
|
||||
_tape = "equip_duct_tape";
|
||||
//Handle
|
||||
_handle = "equip_lever";
|
||||
|
||||
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
call gear_ui_init;
|
||||
closeDialog 0;
|
||||
|
||||
// Check if the player has the tape
|
||||
if ((_tape in magazines player) && (_handle in magazines player) && (_tool in items player)) then {
|
||||
[player,"bandage",0,false] call dayz_zombieSpeak;
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
if (!_finished) exitWith {};
|
||||
|
||||
// Check again to make sure player didn't drop item
|
||||
if ((_tape in magazines player) && (_handle in magazines player) && (_tool in items player)) then {
|
||||
player removeWeapon _tool;
|
||||
player removeMagazine _tape;
|
||||
player removeMagazine _handle;
|
||||
player addWeapon _fixedItem;
|
||||
format[localize "str_fixToolSuccess", _dName] call dayz_rollingMessages;
|
||||
};
|
||||
} else { //If the player doesn't have the mats.
|
||||
if (!(_tape in magazines player)) then {
|
||||
if (!(_handle in magazines player)) then {
|
||||
localize "str_fixToolFail" call dayz_rollingMessages;
|
||||
} else {
|
||||
localize "str_fixtoolMissingTape" call dayz_rollingMessages;
|
||||
};
|
||||
} else {
|
||||
localize "str_fixtoolMissingHandle" call dayz_rollingMessages;
|
||||
};
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
@@ -1,97 +0,0 @@
|
||||
private ["_item","_config","_exit","_text","_booleans","_worldspace","_dir","_location","_fire","_tool","_itemPile","_posASL","_testSea","_finished"];
|
||||
|
||||
_tool = _this;
|
||||
call gear_ui_init;
|
||||
closeDialog 0;
|
||||
|
||||
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
_item = "ItemLog";
|
||||
_itemPile = "PartWoodPile";
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
_text = getText (_config >> "displayName");
|
||||
_exit = false;
|
||||
|
||||
if (_tool == "PartWoodPile") then {
|
||||
_exit = true;
|
||||
{if (_x in DayZ_Ignitors) exitWith {_exit = false};} forEach (items player);
|
||||
};
|
||||
if (_exit) exitWith {
|
||||
localize "str_fireplace_noMatches" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
// item is missing or tools are missing
|
||||
if (!(_item in magazines player) && !(_itemPile in magazines player)) exitWith {
|
||||
localize "str_player_22" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
_booleans = []; //testonLadder, testSea, testPond, testBuilding, testSlope, testDistance
|
||||
_worldspace = ["Land_Fire_DZ", player, _booleans] call fn_niceSpot;
|
||||
|
||||
// player on ladder or in a vehicle
|
||||
if (_booleans select 0) exitWith {
|
||||
localize "str_player_21" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
_testSea = true;
|
||||
_posASL = getPosASL player;
|
||||
if ((_booleans select 1) && _posASL select 2 > 2) then {
|
||||
//Allow building on raised platform 2m+ ASL (like docks)
|
||||
_testSea = false;
|
||||
_worldspace = [0,_posASL];
|
||||
};
|
||||
|
||||
// object would be in the water (pool or sea)
|
||||
if ((_booleans select 1 && _testSea) OR (_booleans select 2)) exitWith {
|
||||
localize "str_player_26" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
if ((count _worldspace) == 2) then {
|
||||
[player,20,true,(getPosATL player)] call player_alertZombies;
|
||||
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
if (!_finished or (!(_item in magazines player) && !(_itemPile in magazines player))) exitWith {};
|
||||
|
||||
if (_item in magazines player) then {
|
||||
player removeMagazine _item;
|
||||
} else {
|
||||
player removeMagazine _itemPile;
|
||||
};
|
||||
_dir = _worldspace select 0;
|
||||
_location = _worldspace select 1;
|
||||
|
||||
// fireplace location may not be in front of player (but in 99% time it should)
|
||||
player setDir _dir;
|
||||
player setPosATL (getPosATL player);
|
||||
|
||||
// Added Nutrition-Factor for work
|
||||
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
|
||||
|
||||
_fire = createVehicle ["Land_Fire_DZ", [0,0,0], [], 0, "CAN_COLLIDE"];
|
||||
_fire setDir _dir;
|
||||
if (_testSea) then {
|
||||
_fire setPos _location; // follow terrain slope
|
||||
} else {
|
||||
_fire setPosASL _location;
|
||||
};
|
||||
player reveal _fire;
|
||||
[_fire,true] call dayz_inflame;
|
||||
_fire spawn player_fireMonitor;
|
||||
|
||||
/*if (dayz_playerAchievements select 14 < 1) then {
|
||||
// Firestarter
|
||||
dayz_playerAchievements set [14,1];
|
||||
achievement = [14, player, dayz_characterID];
|
||||
publicVariableServer "achievement";
|
||||
};*/
|
||||
localize "str_fireplace_01" call dayz_rollingMessages;
|
||||
} else {
|
||||
localize "str_fireplace_02" call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
Reference in New Issue
Block a user