mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-14 20:22:56 +03:00
0.1
This commit is contained in:
21
dayz_code/actions/dog/feed.sqf
Normal file
21
dayz_code/actions/dog/feed.sqf
Normal file
@@ -0,0 +1,21 @@
|
||||
_dog = _this select 0;
|
||||
_array = _this select 3;
|
||||
_handle = _array select 0;
|
||||
_type = _array select 1;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
player playActionNow "PutDown";
|
||||
|
||||
switch (_type) do {
|
||||
case 0: {
|
||||
player removeMagazine "FoodSteakRaw";
|
||||
_handle setFSMVariable ["_hunger",0];
|
||||
};
|
||||
case 1: {
|
||||
player removeMagazine "ItemWaterbottle";
|
||||
player addMagazine "ItemWaterbottleUnfilled";
|
||||
_handle setFSMVariable ["_hunger",0];
|
||||
};
|
||||
};
|
||||
13
dayz_code/actions/dog/follow.sqf
Normal file
13
dayz_code/actions/dog/follow.sqf
Normal file
@@ -0,0 +1,13 @@
|
||||
_dog = _this select 0;
|
||||
_array = _this select 3;
|
||||
_handle = _array select 0;
|
||||
_whistle = _array select 1;
|
||||
|
||||
if(_whistle) then {
|
||||
[nil,player,rSAY,["dog_callBack", 120]] call RE;
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
_handle setFSMVariable ["_command","none"];
|
||||
|
||||
19
dayz_code/actions/dog/speak.sqf
Normal file
19
dayz_code/actions/dog/speak.sqf
Normal file
@@ -0,0 +1,19 @@
|
||||
_dog = _this select 0;
|
||||
_dog playActionNow "GestureBark";
|
||||
[_dog,"dog_bark",0,false] call dayz_zombieSpeak;
|
||||
/*
|
||||
_anim = animationState _dog;
|
||||
_sitDown = false;
|
||||
if(_anim == "Dog_SitDown") then {
|
||||
[objNull, _dog, rSwitchMove,"Dog_SitUp"] call RE;
|
||||
sleep 1;
|
||||
_sitDown = true;
|
||||
};
|
||||
|
||||
[objNull, _dog, rSwitchMove,"Dog_StopV2"] call RE;
|
||||
|
||||
if (_sitDown) then {
|
||||
waitUntil{(animationState _dog) != "Dog_StopV2"};
|
||||
[objNull, _dog, rSwitchMove,"Dog_SitDown"] call RE;
|
||||
};
|
||||
*/
|
||||
33
dayz_code/actions/dog/speed.sqf
Normal file
33
dayz_code/actions/dog/speed.sqf
Normal file
@@ -0,0 +1,33 @@
|
||||
//_dog = _this select 0;
|
||||
_array = _this select 3;
|
||||
_handle = _array select 0;
|
||||
_whistle = _array select 1;
|
||||
_forceWalk = _array select 2;
|
||||
|
||||
_dog = _handle getFSMVariable "_dog";
|
||||
_maxSpeed = _handle getFSMVariable "_maxSpeed";
|
||||
|
||||
if(player distance _dog < 5) then {
|
||||
_whistle = false;
|
||||
};
|
||||
|
||||
if(_forceWalk) then {
|
||||
_maxSpeed = _maxSpeed - 1;
|
||||
if (_maxSpeed < 0) then {
|
||||
_maxSpeed = 0;
|
||||
};
|
||||
if(_whistle) then {
|
||||
[nil,player,rSAY,["dog_slowDown", 120]] call RE;
|
||||
};
|
||||
} else {
|
||||
_maxSpeed = _maxSpeed + 1;
|
||||
if (_maxSpeed > 2) then {
|
||||
_maxSpeed = 2;
|
||||
};
|
||||
if(_whistle) then {
|
||||
[nil,player,rSAY,["dog_speedUp", 120]] call RE;
|
||||
};
|
||||
};
|
||||
|
||||
_handle setFSMVariable ["_maxSpeed",_maxSpeed];
|
||||
_handle setFSMVariable ["_forceChange",true];
|
||||
12
dayz_code/actions/dog/stay.sqf
Normal file
12
dayz_code/actions/dog/stay.sqf
Normal file
@@ -0,0 +1,12 @@
|
||||
_dog = _this select 0;
|
||||
_handle = _this select 3;
|
||||
_standing = _handle getFSMVariable "_standing";
|
||||
_handle setFSMVariable ["_command","stay"];
|
||||
_watchDog = _handle getFSMVariable "_watchDog";
|
||||
|
||||
_anim = animationState _dog;
|
||||
if (_anim == "Dog_SitDown" and _watchDog) then {
|
||||
[objNull, _dog, rSwitchMove,"Dog_SitUp"] call RE;
|
||||
sleep 0.5;
|
||||
[objNull, _dog, rSwitchMove,"Dog_LieDown"] call RE;
|
||||
};
|
||||
8
dayz_code/actions/dog/track.sqf
Normal file
8
dayz_code/actions/dog/track.sqf
Normal file
@@ -0,0 +1,8 @@
|
||||
_array = _this select 3;
|
||||
_handle = _array;
|
||||
//_target = _array select 1;
|
||||
|
||||
_target = target1;
|
||||
|
||||
_handle setFSMVariable ["_command","track"];
|
||||
_handle setFSMVariable ["_target",_target];
|
||||
40
dayz_code/actions/dog/warn.sqf
Normal file
40
dayz_code/actions/dog/warn.sqf
Normal file
@@ -0,0 +1,40 @@
|
||||
_dog = _this select 0;
|
||||
_array = _this select 3;
|
||||
_handle = _array select 0;
|
||||
_watchDog = _array select 1;
|
||||
|
||||
_handle setFSMVariable ["_watchDog",_watchDog];
|
||||
|
||||
_actionWarn = _handle getFSMVariable "_actionWarn";
|
||||
_actionDir = _handle getFSMVariable "_actionDir";
|
||||
_dog removeAction _actionWarn;
|
||||
|
||||
if (_watchDog) then {
|
||||
_actionWarn = _dog addAction ["Quiet",_actionDir + "warn.sqf",[_handle,false], 2, false, true];
|
||||
_handle setFSMVariable ["_actionWarn",_actionWarn];
|
||||
_handle setFSMVariable ["_idleTime",5];
|
||||
while {_watchDog and alive _dog} do {
|
||||
_watchDog = _handle getFSMVariable "_watchDog";
|
||||
_senseSkill = _handle getFSMVariable "_senseSkill";
|
||||
if (_watchDog) then {
|
||||
_nearby = (getPosATL _dog) nearEntities ["CAManBase",_senseSkill];
|
||||
_nearby = _nearby - [player];
|
||||
if (count _nearby > 0) then {
|
||||
//_chance = (3 - (count _nearby));
|
||||
//hintSilent str(_chance);
|
||||
[_dog,"dog_growl",2,false] call dayz_zombieSpeak;
|
||||
} else {
|
||||
/*
|
||||
_nearby = (getPosATL _dog) nearEntities ["CAAnimalBase",_senseSkill];
|
||||
_nearby = _nearby - [_dog];
|
||||
[_dog,"dog_bark",1,false] call dayz_zombieSpeak;
|
||||
*/
|
||||
};
|
||||
};
|
||||
sleep 2;
|
||||
};
|
||||
} else {
|
||||
_actionWarn = _dog addAction ["Alert",_actionDir + "warn.sqf",[_handle,true], 2, false, true];
|
||||
_handle setFSMVariable ["_actionWarn",_actionWarn];
|
||||
_handle setFSMVariable ["_idleTime",1];
|
||||
};
|
||||
Reference in New Issue
Block a user