mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-25 01:49:19 +03:00
0.981 + 1.7.6.1 CE
+ Increased raise horde distance to 65m. + decreased raise horde action timer to 7 seconds. + sync with 1.7.6.1 CE
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
private["_onLadder","_item","_hasdrinkitem","_config","_text","_sfx","_id","_display"];
|
||||
private["_onLadder","_itemorignal","_hasdrinkitem","_hasoutput","_config","_text","_sfx","_dis","_id","_itemtodrop","_nearByPile","_item","_display"];
|
||||
|
||||
disableserialization;
|
||||
call gear_ui_init;
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
if (vehicle player != player) exitWith {cutText ["You may not drink while in a vehicle", "PLAIN DOWN"]};
|
||||
@@ -9,31 +11,60 @@ if (vehicle player != player) exitWith {cutText ["You may not drink while in a v
|
||||
//Force players to wait 3 mins to drink again
|
||||
//if (dayz_lastDrink < 180) exitWith {cutText ["You may not drink, your not thirsty", "PLAIN DOWN"]};
|
||||
|
||||
_item = _this;
|
||||
_hasdrinkitem = _item in magazines player;
|
||||
_itemorignal = _this;
|
||||
_hasdrinkitem = _itemorignal in magazines player;
|
||||
_hasoutput = _itemorignal in drink_with_output;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
_config = configFile >> "CfgMagazines" >> _itemorignal;
|
||||
_text = getText (_config >> "displayName");
|
||||
_sfx = getText (_config >> "sfx");
|
||||
|
||||
//getting type of sfx (now just drink od soda open and drink)
|
||||
_sfx = getText (_config >> "sfx");
|
||||
|
||||
if (!_hasdrinkitem) exitWith {cutText [format[(localize "str_player_31"),_text,"drink"] , "PLAIN DOWN"]};
|
||||
|
||||
player playActionNow "PutDown";
|
||||
player removeMagazine _item;
|
||||
player removeMagazine _itemorignal;
|
||||
sleep 1;
|
||||
[player,_sfx,0,false] call dayz_zombieSpeak;
|
||||
|
||||
if (_item == "ItemWaterbottle" or _item == "ItemWaterbottleBoiled") then {
|
||||
player addMagazine "ItemWaterbottleUnfilled";
|
||||
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;
|
||||
if (["ItemWaterbottle",_itemorignal] call fnc_inString) then {
|
||||
//low alert and sound radius
|
||||
_dis=5;
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
player addMagazine "ItemWaterbottleUnfilled";
|
||||
};
|
||||
if (["ItemSoda",_itemorignal] call fnc_inString) then {
|
||||
//higher alert and sound radius
|
||||
_dis=10;
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
_id = [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
};
|
||||
|
||||
if (_hasoutput) then{
|
||||
// Selecting output
|
||||
_itemtodrop = drink_output select (drink_with_output find _itemorignal);
|
||||
|
||||
sleep 3;
|
||||
_nearByPile= nearestObjects [(position player), ["WeaponHolder","WeaponHolderBase"],2];
|
||||
if (count _nearByPile ==0) then {
|
||||
_item = createVehicle ["WeaponHolder", position player, [], 0.0, "CAN_COLLIDE"];
|
||||
} else {
|
||||
_item = _nearByPile select 0;
|
||||
};
|
||||
_item addMagazineCargoGlobal [_itemtodrop,1];
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//add infection chance for "ItemWaterbottle",
|
||||
if ((random 15 < 1) and (_itemorignal == "ItemWaterbottle")) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
|
||||
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
|
||||
|
||||
dayz_lastDrink = time;
|
||||
|
||||
Reference in New Issue
Block a user