mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-03-01 11:11:52 +03:00
Update private tags
From
e69f8d5306
Moved dog files to the \dog\ folder and pzombie files to the \pzombie\
folder. Also removed some legacy files that are no longer used.
The actions\ and compile\ folders are fully up to date now
This commit is contained in:
@@ -1,70 +1,92 @@
|
||||
private ["_text","_qty","_canFill","_isWell","_objectsWell","_pondPos","_isPond","_objectsPond","_dis","_sfx","_playerPos","_onLadder","_hasbottleitem","_config"];
|
||||
#include "\z\addons\dayz_code\util\player.hpp"
|
||||
|
||||
private ["_water","_filled","_canFill","_infected","_well"];
|
||||
|
||||
call gear_ui_init;
|
||||
closeDialog 0;
|
||||
|
||||
_playerPos = getPosATL player;
|
||||
_canFill = count nearestObjects [_playerPos, ["Land_pumpa","Land_water_tank","Land_Misc_Well_L_EP1","Land_Misc_Well_C_EP1","Land_Barrel_water"], 4] > 0;
|
||||
_isPond = false;
|
||||
_isWell = false;
|
||||
_pondPos = [];
|
||||
_objectsWell = [];
|
||||
if Player_IsOnLadder() exitWith { (localize "str_player_21") call dayz_rollingMessages; };
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [localize "str_player_21","PLAIN DOWN"]};
|
||||
|
||||
_hasbottleitem = _this in magazines player;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _this;
|
||||
_text = getText (_config >> "displayName");
|
||||
|
||||
if (!_hasbottleitem) exitWith {cutText [format[(localize "str_player_31"),_text,"fill"] , "PLAIN DOWN"]};
|
||||
|
||||
if (!dayz_isSwimming) then {
|
||||
player playActionNow "PutDown";
|
||||
};
|
||||
|
||||
if (!_canFill) then {
|
||||
_objectsWell = nearestObjects [_playerPos, [], 4];
|
||||
_water = call
|
||||
{
|
||||
private ["_canFill", "_infected"];
|
||||
|
||||
_canFill = count nearestObjects [player, ["Land_pumpa","Land_water_tank","Land_Barrel_water"], 4] > 0;
|
||||
|
||||
if (_canFill) exitWith { "safe" };
|
||||
|
||||
//Check for wells
|
||||
{
|
||||
//Check for Well
|
||||
_isWell = ["_well",str(_x),false] call fnc_inString;
|
||||
if (_isWell) then {_canFill = true};
|
||||
} count _objectsWell;
|
||||
};
|
||||
|
||||
if (!_canFill) then {
|
||||
_objectsPond = nearestObjects [_playerPos, [], 50];
|
||||
if (["_well", str _x, false] call fnc_inString) exitWith
|
||||
{
|
||||
_canFill = true;
|
||||
};
|
||||
}
|
||||
foreach nearestObjects [player, [], 4];
|
||||
|
||||
if (_canFill) exitWith { "safe" };
|
||||
|
||||
_infected = false;
|
||||
|
||||
//Check for ponds and corpses
|
||||
{
|
||||
//Check for pond
|
||||
_isPond = ["pond",str(_x),false] call fnc_inString;
|
||||
if (_isPond) then {
|
||||
_pondPos = (_x worldToModel _playerPos) select 2;
|
||||
if (_pondPos < 0) then {
|
||||
if (!_canFill) then
|
||||
{
|
||||
if (["pond", str _x, false] call fnc_inString && {((getPosASL player) select 2) < ((GetPosASL _x) select 2)}) then
|
||||
{
|
||||
_canFill = true;
|
||||
};
|
||||
};
|
||||
} count _objectsPond;
|
||||
};
|
||||
|
||||
if (_canFill) then {
|
||||
_qty = {_x == "ItemWaterbottleUnfilled"} count magazines player;
|
||||
|
||||
if ("ItemWaterbottleUnfilled" in magazines player) then {
|
||||
for "_x" from 1 to _qty do {
|
||||
if(([player,"ItemWaterbottleUnfilled"] call BIS_fnc_invRemove) == 1) then {
|
||||
player addMagazine "ItemWaterbottle";
|
||||
|
||||
if (!_infected) then
|
||||
{
|
||||
if (["dead", str _x, false] call fnc_inString || {["massgrave", str _x, false] call fnc_inString}) then
|
||||
{
|
||||
_infected = true;
|
||||
};
|
||||
};
|
||||
|
||||
_dis=5;
|
||||
_sfx = "fillwater";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [localize "str_player_02","PLAIN DOWN"];
|
||||
if (_canFill && {_infected}) exitWith {};
|
||||
}
|
||||
foreach nearestObjects [player, [], 50];
|
||||
|
||||
if (!_canFill) exitWith { nil };
|
||||
|
||||
if (_infected) exitWith { "infected" };
|
||||
|
||||
""
|
||||
};
|
||||
|
||||
if (isNil "_water") exitWith
|
||||
{
|
||||
(localize "str_player_20") call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
_water = "containerwater" + _water;
|
||||
_filled = 0;
|
||||
|
||||
{
|
||||
if (isText (configFile >> "CfgMagazines" >> _x >> _water)) then
|
||||
{
|
||||
if (_filled < 1) then
|
||||
{
|
||||
if (!dayz_isSwimming) then
|
||||
{
|
||||
player playActionNow "PutDown";
|
||||
};
|
||||
|
||||
[player, "fillwater", 0, false, 5] call dayz_zombieSpeak;
|
||||
[player, 5, true, getPosATL player] call player_alertZombies;
|
||||
};
|
||||
|
||||
_filled = _filled + 1;
|
||||
|
||||
player removeMagazine _x;
|
||||
player addMagazine getText (configFile >> "CfgMagazines" >> _x >> _water);
|
||||
};
|
||||
} else {
|
||||
cutText [localize "str_player_20","PLAIN DOWN"];
|
||||
};
|
||||
}
|
||||
foreach magazines player;
|
||||
|
||||
if (_filled > 0)
|
||||
then { (format [localize "str_player_01", _filled]) call dayz_rollingMessages; }
|
||||
else { (localize "str_player_02") call dayz_rollingMessages; };
|
||||
Reference in New Issue
Block a user