mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-22 20:12:20 +03:00
1.0.0.2 pre test
+ [FIXED] Can now refuel and siphon while swimming again. Must stay at same position for 6 seconds. + [FIXED] Refuel sound now only plays when an actual refuel/siphon takes place. + [FIXED] Check fuel levels again just before refuel or siphon actions. + [FIXED] Player Zombies can now no longer pickup "Take %" objects. + [FIXED] Dogs now correctly consume any available raw meat. + [FIXED] Machete now spawns correctly, it was missing WeaponHolder_ItemMachete config. + [UPDATED] Updated batttleye scripts. + [CHANGED] Gutting zombies and animals now double checks for "meatHarvested" after animation and before action. + [CHANGED] Survivor2_DZ was not in the list of AllPlayers. + [CHANGED] Lowered alert radius when gutting zombies to 50m instead of 100m. + [CHANGED] Moved all clothes to cfgloots to reduce spawn chances as we add more. (clothes, militaryclothes, specialclothes) + [CHANGED] HMMWV URAL and UAZ road debris now has its own military loot tables that include sandbags. + [CHANGED] New vehicle spawns now have a new damage system using a random percent between min and max variables. Defaults: (DynamicVehicleDamageLow = 0; DynamicVehicleDamageHigh = 100;) + [CHANGED] Animal count was too low was 5 now 8. Can be overridden with dayz_maxAnimals set inside mission init.sqf. + [ADDED] Taming dogs now has a 50% chance to fail and consume meat, Chance to tame without failure increases with number of days alive (dayz_skilllevel). + [ADDED] Added spawnMarkerCount variable override to use more spawn marker locations. (default=4) + [ADDED] Added medic animation requirement for gutting zombies and animals so you can now walk away to cancel gutting process. + [ADDED] Added old bandit skin back in as Skin_Bandit2_DZ as a drop on Residential. + [ADDED] New vehicle spawns now have a chance to spawn 0-3 loot randomly from all cfgloots. + [ADDED] Added new desert themed domed camping tent (ItemTentDomed) that holds 75 mags, 12 weapons, and 7 backpacks - thanks to vRNemesis for model and texture. + [ADDED] Added server side ability to enabled taming dogs and can be enabled by setting dayz_tameDogs = true; within mission init.sqf. (default: false) + [ADDED] Added parachute spawning players as a server side option enable server side with the variable dayz_paraSpawn = true; within mission init.sqf. (default: false) + [ADDED] Randomly spawning (like helicopter crashes) Mass Grave with 8-16 zombies and 2x more loot. + [REMOVED] Commented out remaining unused call to stream_locationCheck. + [INFO] Changes can be made to all zombie spawn variables via the mission init.sqf (defaults: dayz_maxLocalZombies = 40; dayz_maxGlobalZombies =30; dayz_maxZeds = 500;) + [INFO] DZEdebug = true; (default: false) will enable debug so that road debris and new vehicle spawns are visible via map markers. Also debug will enable "Save to arma.RPT" that allows access of a tool to obtain lootpos information for buildings used for adding support for additional maps.
This commit is contained in:
@@ -29,7 +29,7 @@ _offset_z = 0;
|
||||
_offset_z_attach = 0.5;
|
||||
|
||||
// Start Preview loop
|
||||
_tmpbuilt = createVehicle ["_classname", _location, [], 0, "CAN_COLLIDE"];
|
||||
_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_tmpbuilt setdir _dir;
|
||||
_tmpbuilt attachTo [player,[_offset_x,_offset_y,_offset_z_attach]];
|
||||
|
||||
|
||||
@@ -10,10 +10,20 @@ player playActionNow "PutDown";
|
||||
|
||||
switch (_type) do {
|
||||
case 0: {
|
||||
player removeMagazine "FoodSteakRaw";
|
||||
_handle setFSMVariable ["_hunger",0];
|
||||
player removeAction s_player_feeddog;
|
||||
s_player_feeddog = -1;
|
||||
// expanded to allow all meats as input
|
||||
_removed = 0;
|
||||
_itemIn = "FoodmeatRaw";
|
||||
_countIn = 1;
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
|
||||
};
|
||||
} forEach magazines player;
|
||||
if(_removed == _countIn) then {
|
||||
_handle setFSMVariable ["_hunger",0];
|
||||
player removeAction s_player_feeddog;
|
||||
s_player_feeddog = -1;
|
||||
};
|
||||
|
||||
};
|
||||
case 1: {
|
||||
|
||||
@@ -9,38 +9,74 @@ _config = configFile >> "CfgSurvival" >> "Meat" >> _type;
|
||||
player removeAction s_player_butcher;
|
||||
s_player_butcher = -1;
|
||||
|
||||
|
||||
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
|
||||
//Get Animal Type
|
||||
_isListed = isClass (_config);
|
||||
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
_dis=10;
|
||||
_sfx = "gut";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_item setVariable["meatHarvested",true,true];
|
||||
|
||||
_qty = 2;
|
||||
if (_isListed) then {
|
||||
_qty = getNumber (_config >> "yield");
|
||||
};
|
||||
|
||||
if (_hasKnifeBlunt) then { _qty = round(_qty / 2); };
|
||||
|
||||
_array = [_item,_qty];
|
||||
// Alert zombies
|
||||
[player,10,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
if (local _item) then {
|
||||
_array spawn local_gutObject;
|
||||
} else {
|
||||
dayzGutBody = _array;
|
||||
publicVariable "dayzGutBody";
|
||||
};
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
sleep 6;
|
||||
_string = format[localize "str_success_gutted_animal",_text,_qty];
|
||||
cutText [_string, "PLAIN DOWN"];
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled gutting." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
_hasHarvested = _item getVariable["meatHarvested",false];
|
||||
|
||||
if(_finished and !_hasHarvested) then {
|
||||
|
||||
_item setVariable["meatHarvested",true,true];
|
||||
|
||||
// Play sound since we finished
|
||||
[player,"gut",0,false,10] call dayz_zombieSpeak;
|
||||
|
||||
_qty = 2;
|
||||
if (_isListed) then {
|
||||
_qty = getNumber (_config >> "yield");
|
||||
};
|
||||
|
||||
if (_hasKnifeBlunt) then { _qty = round(_qty / 2); };
|
||||
|
||||
_array = [_item,_qty];
|
||||
|
||||
if (local _item) then {
|
||||
_array spawn local_gutObject;
|
||||
} else {
|
||||
dayzGutBody = _array;
|
||||
publicVariable "dayzGutBody";
|
||||
};
|
||||
|
||||
_string = format[localize "str_success_gutted_animal",_text,_qty];
|
||||
cutText [_string, "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
@@ -15,24 +15,64 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
|
||||
_isListed = isClass (_config);
|
||||
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
[player,"gut",0,false] call dayz_zombieSpeak;
|
||||
_item setVariable["meatHarvested",true,true];
|
||||
|
||||
// Alert zombies
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
_qty = 1;
|
||||
|
||||
_id = [player,100,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_array = [_item,_qty];
|
||||
|
||||
if (local _item) then {
|
||||
_array spawn local_gutObjectZ;
|
||||
} else {
|
||||
dayzGutBody = _array;
|
||||
publicVariable "dayzGutBodyZ";
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled gutting." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
_hasHarvested = _item getVariable["meatHarvested",false];
|
||||
|
||||
sleep 6;
|
||||
_string = format["Successfully Gutted Zombie",_text,_qty];
|
||||
cutText [_string, "PLAIN DOWN"];
|
||||
if(_finished and !_hasHarvested) then {
|
||||
|
||||
_item setVariable["meatHarvested",true,true];
|
||||
|
||||
// Play sound since we finished
|
||||
[player,"gut",0,false,10] call dayz_zombieSpeak;
|
||||
|
||||
_qty = 1;
|
||||
|
||||
_array = [_item,_qty];
|
||||
|
||||
if (local _item) then {
|
||||
_array spawn local_gutObjectZ;
|
||||
} else {
|
||||
dayzGutBody = _array;
|
||||
publicVariable "dayzGutBodyZ";
|
||||
};
|
||||
|
||||
_string = format["Successfully Gutted Zombie",_text,_qty];
|
||||
cutText [_string, "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
@@ -1,5 +1,8 @@
|
||||
private["_array","_type","_classname","_holder","_config","_isOk","_muzzles","_playerID","_claimedBy","_text","_control","_dialog","_item","_val","_max","_bolts","_quivers","_quiver","_broken"];
|
||||
|
||||
// Exit if player zombie
|
||||
if(player isKindOf "PZombie_VB") exitWith {};
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Take item already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
@@ -14,7 +17,7 @@ _text = getText (configFile >> _type >> _classname >> "displayName");
|
||||
_claimedBy = _holder getVariable["claimed","0"];
|
||||
|
||||
// Check if any players are nearby if not allow player to claim item.
|
||||
_playerNear = {isPlayer _x} count (player nearEntities ["AllVehicles", 6]) > 1;
|
||||
_playerNear = {isPlayer _x} count (player nearEntities ["Man", 6]) > 1;
|
||||
|
||||
// Only allow if not already claimed.
|
||||
if (_claimedBy == "0" or !_playerNear) then {
|
||||
@@ -53,33 +56,43 @@ if(_classname isKindOf "Bag_Base_EP1") then {
|
||||
diag_log("Picked up a bag: " + _classname);
|
||||
};
|
||||
|
||||
_config = (configFile >> _type >> _classname);
|
||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
||||
if (_isOk) then {
|
||||
deleteVehicle _holder;
|
||||
if (_classname in ["MeleeHatchet","MeleeCrowbar","MeleeMachete"]) then {
|
||||
// test to see if item still exists just before adding and removing
|
||||
if(_holder == objNull) exitWith {};
|
||||
|
||||
if (_type == "cfgWeapons") then {
|
||||
_muzzles = getArray(configFile >> "cfgWeapons" >> _classname >> "muzzles");
|
||||
//_wtype = ((weapons player) select 0);
|
||||
if (count _muzzles > 1) then {
|
||||
player selectWeapon (_muzzles select 0);
|
||||
} else {
|
||||
player selectWeapon _classname;
|
||||
_obj = nearestObjects [(getPosATL player), [(typeOf _holder)], 5];
|
||||
_qty = count _obj;
|
||||
|
||||
if(_qty >= 1) then {
|
||||
|
||||
_config = (configFile >> _type >> _classname);
|
||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
||||
if (_isOk) then {
|
||||
|
||||
deleteVehicle _holder;
|
||||
if (_classname in ["MeleeHatchet","MeleeCrowbar","MeleeMachete"]) then {
|
||||
|
||||
if (_type == "cfgWeapons") then {
|
||||
_muzzles = getArray(configFile >> "cfgWeapons" >> _classname >> "muzzles");
|
||||
//_wtype = ((weapons player) select 0);
|
||||
if (count _muzzles > 1) then {
|
||||
player selectWeapon (_muzzles select 0);
|
||||
} else {
|
||||
player selectWeapon _classname;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_holder setVariable["claimed","0",true];
|
||||
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
||||
if (_classname == "MeleeCrowbar") then {
|
||||
player removeMagazine 'crowbar_swing';
|
||||
};
|
||||
if (_classname == "MeleeHatchet") then {
|
||||
player removeMagazine 'hatchet_swing';
|
||||
};
|
||||
if (_classname == "MeleeMachete") then {
|
||||
player removeMagazine 'Machete_swing';
|
||||
} else {
|
||||
_holder setVariable["claimed","0",true];
|
||||
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
||||
if (_classname == "MeleeCrowbar") then {
|
||||
player removeMagazine 'crowbar_swing';
|
||||
};
|
||||
if (_classname == "MeleeHatchet") then {
|
||||
player removeMagazine 'hatchet_swing';
|
||||
};
|
||||
if (_classname == "MeleeMachete") then {
|
||||
player removeMagazine 'Machete_swing';
|
||||
};
|
||||
};
|
||||
};
|
||||
TradeInprogress = false;
|
||||
|
||||
@@ -3,8 +3,6 @@ private["_location","_isOk","_dir","_classname","_item"];
|
||||
if(TradeInprogress) exitWith { cutText ["Building already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_location = player modeltoworld [0,1,0];
|
||||
// _location set [2,0];
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_isWater = (surfaceIsWater _location) or dayz_isSwimming;
|
||||
_bypass = false;
|
||||
@@ -18,6 +16,7 @@ _item = _this;
|
||||
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
|
||||
_require = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "require");
|
||||
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
|
||||
_attachToOffset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
|
||||
|
||||
_hasbuilditem = _this in magazines player;
|
||||
_hasrequireditem = _require in items player;
|
||||
@@ -29,15 +28,12 @@ if (_hasrequireditem or _bypass) then {
|
||||
|
||||
_dir = getDir player;
|
||||
|
||||
_offset_x = 0;
|
||||
_offset_y = 1.5;
|
||||
_offset_z = 0;
|
||||
_offset_z_attach = 0.5;
|
||||
_location = [0,0,0];
|
||||
|
||||
// Start Preview loop
|
||||
_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_tmpbuilt setdir _dir;
|
||||
_tmpbuilt attachTo [player,[_offset_x,_offset_y,_offset_z_attach]];
|
||||
_tmpbuilt attachTo [player,_attachToOffset];
|
||||
|
||||
_cancel = false;
|
||||
_counter = 0;
|
||||
@@ -85,9 +81,6 @@ if (_hasrequireditem or _bypass) then {
|
||||
|
||||
if(!_cancel) then {
|
||||
|
||||
_hasbuilditem = _this in magazines player;
|
||||
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
|
||||
|
||||
_dir = getDir player;
|
||||
player removeMagazine _item;
|
||||
|
||||
@@ -104,6 +97,9 @@ if (_hasrequireditem or _bypass) then {
|
||||
|
||||
sleep 5;
|
||||
|
||||
_hasbuilditem = _this in magazines player;
|
||||
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
|
||||
|
||||
player allowDamage false;
|
||||
_object = createVehicle [_classname, _built_location, [], 0, "CAN_COLLIDE"];
|
||||
_object setDir _dir;
|
||||
|
||||
@@ -28,7 +28,7 @@ for "_x" from 1 to _refuelQty do {
|
||||
_fillCounter = _fillCounter + 1;
|
||||
|
||||
if(_refuelQty == 1) then {
|
||||
cutText ["Preparing to refuel, stand still to fill empty jerry can.", "PLAIN DOWN"];
|
||||
cutText ["Preparing to refuel, stand still to drain full jerry can.", "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format[("Preparing to refuel, stand still to drain full jerry can %1 of %2."),_fillCounter,_refuelQty] , "PLAIN DOWN"];
|
||||
};
|
||||
@@ -39,35 +39,49 @@ for "_x" from 1 to _refuelQty do {
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
if(!dayz_isSwimming) then {
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled refuel." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
} else {
|
||||
// Alternate method in water make sure player stays in one spot for 6 seconds
|
||||
_location1 = getPosATL player;
|
||||
sleep 6;
|
||||
_location2 = getPosATL player;
|
||||
|
||||
if(_location1 distance _location2 > 0.1) then {
|
||||
_finished = false;
|
||||
} else {
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled refuel." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
@@ -77,6 +91,11 @@ for "_x" from 1 to _refuelQty do {
|
||||
player removeMagazine "ItemJerrycan";
|
||||
player addMagazine "ItemJerrycanEmpty";
|
||||
|
||||
// Get fuel levels again to prevent wasted gas from others filling
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel + _canSize);
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
publicVariable "dayzSetFuel";
|
||||
if (local _vehicle) then {
|
||||
|
||||
@@ -35,65 +35,93 @@ for "_x" from 1 to _siphonQty do {
|
||||
cutText [format[("Preparing to siphon, stand still to fill empty jerry can %1 of %2."),_fillCounter,_siphonQty] , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
// Play sound and alert zombies
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
// alert zombies
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
if(!dayz_isSwimming) then {
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled siphon." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
// Alternate method in water make sure player stays in one spot for 6 seconds
|
||||
_location1 = getPosATL player;
|
||||
sleep 6;
|
||||
_location2 = getPosATL player;
|
||||
|
||||
if(_location1 distance _location2 > 0.1) then {
|
||||
_finished = false;
|
||||
} else {
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
cutText ["Canceled siphon." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
if ("ItemJerrycanEmpty" in magazines player) then {
|
||||
|
||||
// Play sound
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
|
||||
player removeMagazine "ItemJerrycanEmpty";
|
||||
player addMagazine "ItemJerrycan";
|
||||
|
||||
//apply newFuel to vehicle on every peer
|
||||
//["dayzSetFuel",[_vehicle,_newFuel]] call broadcastRpcCallAll;
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
};
|
||||
publicVariable "dayzSetFuel";
|
||||
// Get fuel levels again to ensure proper fuel level from others siphoning
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel - _canSize);
|
||||
|
||||
cutText [format["%1 has been drained for %2 litres of Fuel",_nameType,_canSize], "PLAIN DOWN"];
|
||||
// calculate minimum needed fuel
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
if (_newFuel > 0) then {
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
};
|
||||
publicVariable "dayzSetFuel";
|
||||
|
||||
cutText [format["%1 has been drained for %2 litres of Fuel",_nameType,_canSize], "PLAIN DOWN"];
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
sleep 1;
|
||||
sleep 1;
|
||||
} else {
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
_abort = true;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
File: tame_dog.sqf
|
||||
File: tame_dog.sqf 1.1
|
||||
Author: Kane "Alby" Stone
|
||||
Edited by: [VB]AWOL
|
||||
|
||||
Description:
|
||||
Allows a player to tame/domesticate a dog.
|
||||
@@ -19,18 +20,47 @@ _caller = _this select 1;
|
||||
_id = _this select 2;
|
||||
_dog = _this select 3;
|
||||
|
||||
player removeMagazine "FoodSteakRaw";
|
||||
_animalID = _dog getVariable "fsm_handle";
|
||||
_animalID setFSMVariable ["_isTamed", true];
|
||||
sleep 1;
|
||||
diag_log format["DEBUG: %1, id: %2 [%3]",_dog,_animalID,completedFSM _animalID];
|
||||
if (!moveToCompleted _dog) then {
|
||||
_dog moveTo (position _dog);
|
||||
};
|
||||
_dog disableAI "FSM";
|
||||
(group _dog) setBehaviour "AWARE";
|
||||
_fsmid = [_dog, typeOf _dog] execFSM "\z\addons\dayz_code\system\dog_agent.fsm";
|
||||
_fsmid setFSMVariable ["_handle", _fsmid];
|
||||
player setVariable ["dogID", _fsmid];
|
||||
_dog setVariable ["fsm_handle", _fsmid];
|
||||
_dog setVariable ["characterID", dayz_characterID, true];
|
||||
// expanded to allow all meats as input
|
||||
_removed = 0;
|
||||
_itemIn = "FoodmeatRaw";
|
||||
_countIn = 1;
|
||||
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
|
||||
};
|
||||
if(_removed == 1) exitWith { _selected = _x; };
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
// get name of item removed
|
||||
_textRemoved = getText(configFile >> "CfgMagazines" >> _selected >> "displayName");
|
||||
|
||||
// Only proceed if removed count matches
|
||||
if(_removed == _countIn) then {
|
||||
|
||||
// add failure rate based on skill level variable (days alive)
|
||||
_chanceToFail = ((random 1 + (dayz_skilllevel/100)) > 0.5);
|
||||
|
||||
if(!_chanceToFail) then {
|
||||
|
||||
_animalID = _dog getVariable "fsm_handle";
|
||||
_animalID setFSMVariable ["_isTamed", true];
|
||||
sleep 1;
|
||||
diag_log format["DEBUG: %1, id: %2 [%3]",_dog,_animalID,completedFSM _animalID];
|
||||
if (!moveToCompleted _dog) then {
|
||||
_dog moveTo (position _dog);
|
||||
};
|
||||
_dog disableAI "FSM";
|
||||
(group _dog) setBehaviour "AWARE";
|
||||
_fsmid = [_dog, typeOf _dog] execFSM "\z\addons\dayz_code\system\dog_agent.fsm";
|
||||
_fsmid setFSMVariable ["_handle", _fsmid];
|
||||
player setVariable ["dogID", _fsmid];
|
||||
_dog setVariable ["fsm_handle", _fsmid];
|
||||
_dog setVariable ["characterID", dayz_characterID, true];
|
||||
|
||||
cutText [format["Dog consumed %1, and is now tamed.",_textRemoved], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format["Dog consumed %1, yet remains untamed.",_textRemoved], "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
@@ -47,20 +47,20 @@ if (!_isOk) then {
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Pitch" >> "create");
|
||||
|
||||
sleep 5;
|
||||
//place tent (local)
|
||||
_tent = createVehicle ["TentStorage", _location, [], 0, "CAN_COLLIDE"];
|
||||
_tent setdir _dir;
|
||||
_tent setpos _location;
|
||||
player reveal _tent;
|
||||
_location = getPosATL _tent;
|
||||
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_object setdir _dir;
|
||||
_object setpos _location;
|
||||
player reveal _object;
|
||||
_location = getPosATL _object;
|
||||
|
||||
_tent setVariable ["characterID",dayz_characterID,true];
|
||||
_object setVariable ["characterID",dayz_characterID,true];
|
||||
|
||||
//player setVariable ["tentUpdate",["Land_A_tent",_dir,_location,[dayz_tentWeapons,dayz_tentMagazines,dayz_tentBackpacks]],true];
|
||||
|
||||
//["dayzPublishObj",[dayz_characterID,_tent,[_dir,_location],"TentStorage"]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_tent,[_dir,_location],"TentStorage"];
|
||||
//["dayzPublishObj",[dayz_characterID,_tent,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
|
||||
cutText [localize "str_success_tent_pitch", "PLAIN DOWN"];
|
||||
|
||||
Reference in New Issue
Block a user