mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-11 02:32:55 +03:00
0.9 + pre 1.7.5
This commit is contained in:
32
dayz_code/actions/boil.sqf
Normal file
32
dayz_code/actions/boil.sqf
Normal file
@@ -0,0 +1,32 @@
|
||||
private["_hasbottleitem","_hastinitem","_bottletext","_tin1text","_tin2text","_tintext","_qty","_id"];
|
||||
|
||||
player removeAction s_player_boil;
|
||||
s_player_boil = -1;
|
||||
|
||||
_hasbottleitem = "ItemWaterbottle" in magazines player;
|
||||
_hastinitem = ("TrashTinCan" in magazines player) or ("ItemSodaEmpty" in magazines player);
|
||||
|
||||
_bottletext = getText (configFile >> "CfgMagazines" >> "ItemWaterbottle" >> "displayName");
|
||||
_tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName");
|
||||
_tin2text = getText (configFile >> "CfgMagazines" >> "ItemSodaEmpty" >> "displayName");
|
||||
_tintext = format["%1 / %2",_tin1text,_tin2text];
|
||||
if (!_hasbottleitem) exitWith {cutText [format[(localize "str_player_31"),_bottletext,"fill"] , "PLAIN DOWN"]};
|
||||
if (!_hastinitem) exitWith {cutText [format[(localize "str_player_31"),_tintext,"fill"] , "PLAIN DOWN"]};
|
||||
|
||||
if (_hasbottleitem and _hastinitem) then {
|
||||
_qty = {_x == "ItemWaterbottle"} count magazines player;
|
||||
if ("ItemWaterbottle" in magazines player) then {
|
||||
player playActionNow "Medic";
|
||||
[player,"fillwater",0,false] call dayz_zombieSpeak;
|
||||
_id = [player,10,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep _qty;
|
||||
for "_x" from 1 to _qty do {
|
||||
player removeMagazine "ItemWaterbottle";
|
||||
player addMagazine "ItemWaterbottleBoiled";
|
||||
|
||||
};
|
||||
cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [(localize "str_player_02") , "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
@@ -1,105 +1,26 @@
|
||||
private["_hasFoodMeat","_hasFoodTin","_item","_wait"];
|
||||
private["_config","_item","_text","_rawmeat","_cookedmeat","_meat","_meatcooked","_qty","_id"];
|
||||
|
||||
player removeAction s_player_cook;
|
||||
s_player_cook = -1;
|
||||
|
||||
//_qty = {_x == "FoodSteakRaw"} count magazines player;
|
||||
_wait = 5 - _qty;
|
||||
_rawmeat = meatraw;
|
||||
_cookedmeat = meatcooked;
|
||||
|
||||
if ("FoodSteakRaw" in magazines player) then {
|
||||
_qty = {_x == "FoodSteakRaw"} count magazines player;
|
||||
player playActionNow "Medic";
|
||||
[player,"cook",0,false] call dayz_zombieSpeak;
|
||||
_id = [player,70,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep _wait;
|
||||
for "_x" from 1 to _qty do {
|
||||
_hasFoodMeat = "FoodSteakRaw" in magazines player;
|
||||
if (!_hasFoodMeat) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
|
||||
player removeMagazine "FoodSteakRaw";
|
||||
player addMagazine "FoodSteakCooked";
|
||||
sleep 1;
|
||||
};
|
||||
cutText [format[(localize "str_success_cooked"),_qty,(localize "STR_EQUIP_NAME_24")], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
//FoodmuttonRaw > FoodmuttonCooked
|
||||
if ("FoodmuttonRaw" in magazines player) then {
|
||||
_qty = {_x == "FoodmuttonRaw"} count magazines player;
|
||||
player playActionNow "Medic";
|
||||
[player,"cook",0,false] call dayz_zombieSpeak;
|
||||
_id = [player,70,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep _wait;
|
||||
for "_x" from 1 to _qty do {
|
||||
_hasFoodMeat = "FoodmuttonRaw" in magazines player;
|
||||
if (!_hasFoodMeat) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
|
||||
player removeMagazine "FoodmuttonRaw";
|
||||
player addMagazine "FoodmuttonCooked";
|
||||
sleep 1;
|
||||
};
|
||||
cutText [format[(localize "str_success_cooked"),_qty,(localize "STR_EQUIP_NAME_24")], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
//FoodchickenRaw > FoodchickenCooked
|
||||
if ("FoodchickenRaw" in magazines player) then {
|
||||
_qty = {_x == "FoodchickenRaw"} count magazines player;
|
||||
player playActionNow "Medic";
|
||||
[player,"cook",0,false] call dayz_zombieSpeak;
|
||||
_id = [player,70,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep _wait;
|
||||
for "_x" from 1 to _qty do {
|
||||
_hasFoodMeat = "FoodchickenRaw" in magazines player;
|
||||
if (!_hasFoodMeat) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
|
||||
player removeMagazine "FoodchickenRaw";
|
||||
player addMagazine "FoodchickenCooked";
|
||||
sleep 1;
|
||||
};
|
||||
cutText [format[(localize "str_success_cooked"),_qty,(localize "STR_EQUIP_NAME_24")], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
//FoodrabbitRaw > FoodBaconCooked
|
||||
if ("FoodrabbitRaw" in magazines player) then {
|
||||
_qty = {_x == "FoodrabbitRaw"} count magazines player;
|
||||
player playActionNow "Medic";
|
||||
[player,"cook",0,false] call dayz_zombieSpeak;
|
||||
_id = [player,70,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep _wait;
|
||||
for "_x" from 1 to _qty do {
|
||||
_hasFoodMeat = "FoodrabbitRaw" in magazines player;
|
||||
if (!_hasFoodMeat) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
|
||||
player removeMagazine "FoodrabbitRaw";
|
||||
player addMagazine "FoodRabbitCooked";
|
||||
sleep 1;
|
||||
};
|
||||
cutText [format[(localize "str_success_cooked"),_qty,(localize "STR_EQUIP_NAME_24")], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
//FoodbaconRaw > FoodRabbitCooked
|
||||
if ("FoodbaconRaw" in magazines player) then {
|
||||
_qty = {_x == "FoodbaconRaw"} count magazines player;
|
||||
player playActionNow "Medic";
|
||||
[player,"cook",0,false] call dayz_zombieSpeak;
|
||||
_id = [player,70,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep _wait;
|
||||
for "_x" from 1 to _qty do {
|
||||
_hasFoodMeat = "FoodbaconRaw" in magazines player;
|
||||
if (!_hasFoodMeat) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
|
||||
player removeMagazine "FoodbaconRaw";
|
||||
player addMagazine "FoodBaconCooked";
|
||||
sleep 1;
|
||||
};
|
||||
cutText [format[(localize "str_success_cooked"),_qty,(localize "STR_EQUIP_NAME_24")], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
/*
|
||||
_hasFoodMeat = "FoodSteakRaw" in magazines player;
|
||||
_qty = {_x == "ItemWaterbottleUnfilled"} count magazines player;
|
||||
|
||||
if (_hasFoodMeat) then {
|
||||
player removeMagazine "FoodSteakRaw";
|
||||
player playActionNow "Medic";
|
||||
[player,"eat",0,false] call dayz_zombieSpeak;
|
||||
sleep 6;
|
||||
player addMagazine "FoodSteakCooked";
|
||||
cutText [localize "str_success_cooked_steak", "PLAIN DOWN"];
|
||||
};
|
||||
*/
|
||||
{
|
||||
_meat = _x;
|
||||
_meatcooked = _cookedmeat select (_rawmeat find _meat);
|
||||
if (_meat in magazines player) then {
|
||||
_text = getText (configFile >> "CfgMagazines" >> _meatcooked >> "displayName");
|
||||
_qty = {_x == _meat} count magazines player;
|
||||
player playActionNow "Medic";
|
||||
[player,"cook",0,false] call dayz_zombieSpeak;
|
||||
//_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep _qty;
|
||||
for "_x" from 1 to _qty do {
|
||||
player removeMagazine _meat;
|
||||
player addMagazine _meatcooked;
|
||||
if !(_meat in magazines player) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
|
||||
};
|
||||
cutText [format[(localize "str_success_cooked"),_qty,_text], "PLAIN DOWN"];
|
||||
};
|
||||
} forEach _rawmeat;
|
||||
@@ -10,6 +10,7 @@ if (["forest",dayz_surfaceType] call fnc_inString) then {
|
||||
} else {
|
||||
cutText [localize "str_player_24", "PLAIN DOWN"];
|
||||
};
|
||||
_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
} else {
|
||||
cutText [localize "str_player_23", "PLAIN DOWN"];
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
private["_hasFood","_item","_text","_key","_config","_sfx"];
|
||||
private["_onLadder","_item","_hasdrinkitem","_config","_text","_sfx","_id","_display"];
|
||||
disableserialization;
|
||||
call gear_ui_init;
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
@@ -10,10 +10,7 @@ if (vehicle player != player) exitWith {cutText ["You may not drink while in a v
|
||||
//if (dayz_lastDrink < 180) exitWith {cutText ["You may not drink, your not thirsty", "PLAIN DOWN"]};
|
||||
|
||||
_item = _this;
|
||||
_hasdrinkitem = _this in magazines player;
|
||||
|
||||
_rndInfection = (random 15);
|
||||
_DrinkInfection = (_rndInfection < 1);
|
||||
_hasdrinkitem = _item in magazines player;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
_text = getText (_config >> "displayName");
|
||||
@@ -26,32 +23,24 @@ player removeMagazine _item;
|
||||
sleep 1;
|
||||
[player,_sfx,0,false] call dayz_zombieSpeak;
|
||||
|
||||
|
||||
if (_item == "ItemWaterbottle") then {
|
||||
if (_item == "ItemWaterbottle" or _item == "ItemWaterbottleBoiled") then {
|
||||
player addMagazine "ItemWaterbottleUnfilled";
|
||||
if (_DrinkInfection) then {
|
||||
if ((random 15 < 1) and (_item == "ItemWaterbottle")) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true];
|
||||
};
|
||||
//_id = [player,5,true,(getPosATL player)] spawn player_alertZombies;
|
||||
} else {
|
||||
player addMagazine "ItemSodaEmpty";
|
||||
_id = [player,10,true,(getPosATL player)] spawn player_alertZombies;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
|
||||
|
||||
/*
|
||||
_update = player getVariable["updatePlayer",[false,false,false,false,false]];
|
||||
_update set [4,true];
|
||||
player setVariable["updatePlayer",_update,true];
|
||||
*/
|
||||
|
||||
_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
dayz_lastDrink = time;
|
||||
dayz_thirst = 0;
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_control = _display displayCtrl 1302;
|
||||
_control ctrlShow true;
|
||||
(_display displayCtrl 1302) ctrlShow true;
|
||||
|
||||
cutText [format[(localize "str_player_consumed"),_text], "PLAIN DOWN"];
|
||||
cutText [format[(localize "str_player_consumed"),_text], "PLAIN DOWN"];
|
||||
@@ -1,25 +1,21 @@
|
||||
private ["_onLadder","_item","_config","_text","_regen","_display","_control","_bloodVal","_ctrlBlood","_rndInfection","_cookedfood","_hasfooditem","_EatInfection","_id"];
|
||||
private["_onLadder","_item","_hasfooditem","_rawfood","_cookedfood","_config","_text","_regen","_id","_display"];
|
||||
disableserialization;
|
||||
call gear_ui_init;
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_cookedfood = _item in ["FoodSteakCooked","FoodmuttonCooked","FoodchickenCooked","FoodRabbitCooked","FoodBaconCooked","FoodBioMeat"];
|
||||
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
if (vehicle player != player) exitWith {cutText ["You may not eat while in a vehicle", "PLAIN DOWN"]};
|
||||
|
||||
//Force players to wait 3 mins to eat again
|
||||
//if (dayz_lastMeal < 180) exitWith {cutText ["You may not eat, you're already full", "PLAIN DOWN"]};
|
||||
|
||||
_item = _this;
|
||||
_hasfooditem = _this in magazines player;
|
||||
_hasfooditem = _item in magazines player;
|
||||
|
||||
if (_item == "FoodBioMeat") then {
|
||||
_rndInfection = (random 7);
|
||||
} else {
|
||||
_rndInfection = (random 15);
|
||||
};
|
||||
|
||||
_EatInfection = (_rndInfection < 1);
|
||||
//_rawfood = _item in ["FoodSteakRaw","FoodmeatRaw","FoodbeefRaw","FoodmuttonRaw","FoodchickenRaw","FoodrabbitRaw","FoodbaconRaw"];
|
||||
//_cookedfood = _item in ["FoodSteakCooked","FoodmeatCooked","FoodbeefCooked","FoodmuttonCooked","FoodchickenCooked","FoodrabbitCooked","FoodbaconCooked"];
|
||||
_rawfood = _item in meatraw;
|
||||
_cookedfood = item in meatcooked;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
_text = getText (_config >> "displayName");
|
||||
@@ -27,14 +23,6 @@ _regen = getNumber (_config >> "bloodRegen");
|
||||
|
||||
if (!_hasfooditem) exitWith {cutText [format[(localize "str_player_31"),_text,"consume"] , "PLAIN DOWN"]};
|
||||
|
||||
if (_EatInfection and _cookedfood) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true];
|
||||
};
|
||||
|
||||
//Rawtime = getVarable _item
|
||||
//_Cookedtime = _item getVariable ["timemeatCooked", time];
|
||||
|
||||
player playActionNow "PutDown";
|
||||
player removeMagazine _item;
|
||||
sleep 1;
|
||||
@@ -45,6 +33,17 @@ if (dayz_lastMeal < 3600) then {
|
||||
};
|
||||
};
|
||||
|
||||
if ( _rawfood and (random 15 < 1)) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true];
|
||||
};
|
||||
|
||||
[player,"eat",0,false] call dayz_zombieSpeak;
|
||||
|
||||
if (!_rawfood and !_cookedfood) then{
|
||||
player addMagazine "TrashTinCan";
|
||||
};
|
||||
|
||||
r_player_blood = r_player_blood + _regen;
|
||||
if (r_player_blood > r_player_bloodTotal) then {
|
||||
r_player_blood = r_player_bloodTotal;
|
||||
@@ -54,26 +53,18 @@ player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
|
||||
player setVariable["USEC_BloodQty",r_player_blood,true];
|
||||
player setVariable["medForceUpdate",true];
|
||||
|
||||
[player,"eat",0,false] call dayz_zombieSpeak;
|
||||
/*
|
||||
_update = player getVariable["updatePlayer",[false,false,false,false,false]];
|
||||
_update set [3,true];
|
||||
player setVariable["updatePlayer",_update,true];
|
||||
*/
|
||||
["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
|
||||
|
||||
dayz_lastMeal = time;
|
||||
dayz_hunger = 0;
|
||||
|
||||
_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
_id = [player,5,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_control = _display displayCtrl 1301;
|
||||
_control ctrlShow true;
|
||||
(_display displayCtrl 1301) ctrlShow true;
|
||||
|
||||
_bloodVal = r_player_blood / r_player_bloodTotal;
|
||||
if (_bloodVal >= 0.2) then {
|
||||
_ctrlBlood ctrlShow true;
|
||||
if (r_player_blood / r_player_bloodTotal >= 0.2) then {
|
||||
(_display displayCtrl 1300) ctrlShow true;
|
||||
};
|
||||
cutText [format[(localize "str_player_consumed"),_text], "PLAIN DOWN"];
|
||||
@@ -47,7 +47,6 @@ if (_section and _hasToolbox) then {
|
||||
|
||||
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||
dayz_myCursorTarget = objNull;
|
||||
s_player_repair_crtl = -1;
|
||||
|
||||
//check if repaired fully
|
||||
_hitpoints = _vehicle call vehicle_getHitpoints;
|
||||
@@ -63,4 +62,5 @@ _allFixed = true;
|
||||
if (_allFixed) then {
|
||||
_vehicle setDamage 0;
|
||||
["dayzUpdateVehicle",[_vehicle,"repair"]] call callRpcProcedure;
|
||||
};
|
||||
};
|
||||
s_player_repair_crtl = -1;
|
||||
@@ -49,7 +49,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
|
||||
if( _part == "PartGlass" or _part == "PartWheel" ) then {
|
||||
|
||||
_color = "color='#ff0000'"; //red
|
||||
_string = format["<t %2>Remove %1</t>",_cmpt,_color]; //Remove - Part
|
||||
_string = format["<t %2>Remove%1</t>",_cmpt,_color]; //Remove - Part
|
||||
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
|
||||
s_player_repairActions set [count s_player_repairActions,_handle];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user