diff --git a/SQF/dayz_code/achievements/achievements.sqf b/SQF/dayz_code/achievements/achievements.sqf
index 12cb6abf4..4560392ab 100644
--- a/SQF/dayz_code/achievements/achievements.sqf
+++ b/SQF/dayz_code/achievements/achievements.sqf
@@ -1,5 +1,5 @@
achievementClientMsg = {
- private ["_achievement","_player","_AchievementText","_text","_display"];
+ private ["_achievement","_player","_AchievementText","_text","_display","_achievementID","_serverEvent"];
/* Only call this from the server
achievementClientPV = [_achievementID];
diff --git a/SQF/dayz_code/achievements/achievementsServer.sqf b/SQF/dayz_code/achievements/achievementsServer.sqf
index 5ac67978d..699867018 100644
--- a/SQF/dayz_code/achievements/achievementsServer.sqf
+++ b/SQF/dayz_code/achievements/achievementsServer.sqf
@@ -1,5 +1,5 @@
achievementServer = {
- private ["_playerOwnerID","_player","_achievementID","_achievements"];
+private ["_playerOwnerID","_player","_achievementID","_achievements"];
_achievementID = (_this select 0) select 0;
_player = (_this select 0) select 1;
diff --git a/SQF/dayz_code/actions/checkclass.sqf b/SQF/dayz_code/actions/checkclass.sqf
deleted file mode 100644
index 5f3abec1d..000000000
--- a/SQF/dayz_code/actions/checkclass.sqf
+++ /dev/null
@@ -1,10 +0,0 @@
-_object_type = typeOf cursorTarget;
-_fuellevels = fuel cursorTarget;
-_dmglevels = damage cursorTarget;
-
-//remove action menu
-player removeAction s_player_debugCheck;
-s_player_debugCheck = -1;
-
-hintSilent format ["Object: %1, Fuel: %2, Damage: %3", _object_type, _fuellevels, _dmglevels];
-diag_log format ["Object: %1, Fuel: %2, Damage: %3", _object_type, _fuellevels, _dmglevels];
\ No newline at end of file
diff --git a/SQF/dayz_code/actions/detonate_bomb.sqf b/SQF/dayz_code/actions/detonate_bomb.sqf
index d39aad2d5..7d5f0b2d3 100644
--- a/SQF/dayz_code/actions/detonate_bomb.sqf
+++ b/SQF/dayz_code/actions/detonate_bomb.sqf
@@ -1,4 +1,5 @@
-private["_bombData","_vehicle","_owner","_bombar"];
+private ["_bombData","_vehicle","_owner","_bombar","_bombCar","_bomb"];
+
_bombData = _this select 0;
_vehicle = _bombData select 0;
diff --git a/SQF/dayz_code/compile/player_tameDog.sqf b/SQF/dayz_code/actions/dog/player_tameDog.sqf
similarity index 100%
rename from SQF/dayz_code/compile/player_tameDog.sqf
rename to SQF/dayz_code/actions/dog/player_tameDog.sqf
diff --git a/SQF/dayz_code/actions/tame_dog.sqf b/SQF/dayz_code/actions/dog/tame_dog.sqf
similarity index 100%
rename from SQF/dayz_code/actions/tame_dog.sqf
rename to SQF/dayz_code/actions/dog/tame_dog.sqf
diff --git a/SQF/dayz_code/compile/tame_dog.sqf b/SQF/dayz_code/actions/dog/tame_dog_old.sqf
similarity index 100%
rename from SQF/dayz_code/compile/tame_dog.sqf
rename to SQF/dayz_code/actions/dog/tame_dog_old.sqf
diff --git a/SQF/dayz_code/actions/fire_light.sqf b/SQF/dayz_code/actions/fire_light.sqf
deleted file mode 100644
index e3ca97083..000000000
--- a/SQF/dayz_code/actions/fire_light.sqf
+++ /dev/null
@@ -1,18 +0,0 @@
-private["_location","_isOk","_dir","_classname"];
-_location = player modeltoworld [0,1,0];
-_location set [2,0];
-_isOk = count (_location isFlatEmpty [0.5,0,0,4,0,false,player]) > 0;
-
-if (_isOk) then {
- _dir = getDir player;
- _classname = "Land_Fire";
- ["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
- player playActionNow "Medic";
- uiSleep 6;
- dayz_hasFire = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
- dayz_hasFire setDir _dir;
- player reveal dayz_hasFire;
- cutText [localize "str_fireplace_01", "PLAIN DOWN"];
-} else {
- cutText [localize "str_fireplace_02", "PLAIN DOWN"];
-};
\ No newline at end of file
diff --git a/SQF/dayz_code/actions/flare_drop.sqf b/SQF/dayz_code/actions/flare_drop.sqf
index 9d217f0a2..8444b2a37 100644
--- a/SQF/dayz_code/actions/flare_drop.sqf
+++ b/SQF/dayz_code/actions/flare_drop.sqf
@@ -1,4 +1,5 @@
-private["_flare"];
+private ["_flare"];
+
_flare = _this select 3;
player removeAction s_player_dropflare;
detach _flare;
diff --git a/SQF/dayz_code/actions/flare_pickup.sqf b/SQF/dayz_code/actions/flare_pickup.sqf
index e56f434b4..70e89b662 100644
--- a/SQF/dayz_code/actions/flare_pickup.sqf
+++ b/SQF/dayz_code/actions/flare_pickup.sqf
@@ -1,4 +1,5 @@
-private ["_flare","_text"];
+private["_flare","_text"];
+
_flare = _this select 3;
player playActionNow "PutDown";
uiSleep 2;
@@ -14,7 +15,7 @@ dayz_hasLight = true;
_text = getText (configFile >> "CfgAmmo" >> (typeOf _flare) >> "displayName");
s_player_dropflare = player addAction [format[localize "str_actions_medical_16",_text], "\z\addons\dayz_code\actions\flare_drop.sqf",_flare, 1, false, true, "", ""];
-while {(alive _flare) && dayz_hasLight} do {
+while {(alive _flare) and dayz_hasLight} do {
uiSleep 0.1;
};
if (dayz_hasLight) then {
diff --git a/SQF/dayz_code/actions/jerry_fill.sqf b/SQF/dayz_code/actions/jerry_fill.sqf
index 668fa8356..14bc7eb21 100644
--- a/SQF/dayz_code/actions/jerry_fill.sqf
+++ b/SQF/dayz_code/actions/jerry_fill.sqf
@@ -1,91 +1,65 @@
-private ["_qty","_started","_finished","_animState","_isMedic","_abort","_fillCounter","_dis","_sfx","_displayName","_fuelCans"];
-
if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_34","PLAIN DOWN"];};
DZE_ActionInProgress = true;
+private ["_qty","_dis","_sfx","_started","_finished","_animState","_isRefuel","_fuelcans","_qty20","_qty5","_qty40"];
player removeAction s_player_fillfuel;
-s_player_fillfuel = 1;
+//s_player_fillfuel = -1;
-_fillCounter = 0;
-_abort = false;
+_fuelcans = ["ItemFuelcanEmpty","ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
-_fuelCans = [];
+_qty = 0;
+_qty = {_x in _fuelcans} count magazines player;
-{
- if(_x == "ItemJerrycanEmpty" || _x == "ItemFuelBarrelEmpty") then {
- _fuelCans set [(count _fuelCans),_x];
- };
-} count magazines player;
+_qty20 = {_x == "ItemJerrycanEmpty"} count magazines player;
+_qty5 = {_x == "ItemFuelcanEmpty"} count magazines player;
+_qty40 = {_x == "ItemFuelBarrelEmpty"} count magazines player;
-_qty = count _fuelCans;
-
-{
- _displayName = getText (configFile >> "cfgMagazines" >> _x >> "displayName");
-
- _fillCounter = _fillCounter + 1;
-
- cutText [format[(localize "str_siphon_preparing"),_displayName], "PLAIN DOWN"];
-
- ["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
- // force animation
+if (("ItemJerrycanEmpty" in magazines player) or ("ItemFuelcanEmpty" in magazines player) or ("ItemFuelBarrelEmpty" in magazines player)) then {
player playActionNow "Medic";
- // Play sound && alert zombies
-
- _dis=10;
- _sfx = "refuel";
- [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
- [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
- r_interrupt = false;
- _animState = animationState player;
+ _dis=5;
+ _sfx = "refuel";
+ [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
+ [player,_dis,true,(getPosATL player)] call player_alertZombies;
+
+ // Added Nutrition-Factor for work
+ ["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
+
r_doLoop = true;
_started = false;
_finished = false;
-
while {r_doLoop} do {
_animState = animationState player;
- _isMedic = ["medic",_animState] call fnc_inString;
- if (_isMedic) then {
+ _isRefuel = ["medic",_animState] call fnc_inString;
+ if (_isRefuel) then {
_started = true;
};
- if (_started && !_isMedic) then {
+ if (_started and !_isRefuel) then {
r_doLoop = false;
_finished = true;
};
- if (r_interrupt) then {
- r_doLoop = false;
- };
uiSleep 0.1;
};
+
r_doLoop = false;
- if (!_finished) exitWith {
- r_interrupt = false;
- if (vehicle player == player) then {
- [objNull, player, rSwitchMove,""] call RE;
- player playActionNow "stop";
+ if (_finished) then {
+ for "_x" from 1 to _qty20 do {
+ player removeMagazine "ItemJerrycanEmpty";
+ player addMagazine "ItemJerrycan";
+ };
+ for "_x" from 1 to _qty5 do {
+ player removeMagazine "ItemFuelcanEmpty";
+ player addMagazine "ItemFuelcan";
+ };
+ for "_x" from 1 to _qty40 do {
+ player removeMagazine "ItemFuelBarrelEmpty";
+ player addMagazine "ItemFuelBarrel";
};
- cutText [localize "str_siphon_canceled","PLAIN DOWN"];
- _abort = true;
};
- if (_finished) then {
- if(([player,_x] call BIS_fnc_invRemove) == 1) then {
- if (_x == "ItemFuelBarrelEmpty") then {
- player addMagazine "ItemFuelBarrel";
- } else {
- player addMagazine "ItemJerrycan";
- };
- cutText [format[(localize "str_epoch_player_134"),_displayName], "PLAIN DOWN"];
- } else {
- _abort = true;
- };
- };
-
- uiSleep 1;
- if(_abort) exitWith {};
-
-} count _fuelCans;
-
-s_player_fillfuel = -1;
+ cutText [format [localize "str_player_09",_qty], "PLAIN DOWN"];
+} else {
+ cutText [localize "str_player_10", "PLAIN DOWN"];
+};
DZE_ActionInProgress = false;
\ No newline at end of file
diff --git a/SQF/dayz_code/actions/maintain_area.sqf b/SQF/dayz_code/actions/maintain_area.sqf
index 3e0213054..79aa28486 100644
--- a/SQF/dayz_code/actions/maintain_area.sqf
+++ b/SQF/dayz_code/actions/maintain_area.sqf
@@ -1,4 +1,4 @@
-//Code developed by Axe Cop - Massiv improvments && performance tunes by Skaronator
+//Code developed by Axe Cop - Massiv improvments and performance tunes by Skaronator
private ["_missing","_missingQty","_proceed","_itemIn","_countIn","_qty","_num_removed","_uniqueID","_removed","_removed_total","_tobe_removed_total","_obj","_objectID","_objectUID","_classname","_location","_dir","_objectCharacterID","_object","_temp_removed_array","_textMissing","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_itemText","_option"];
if (DZE_ActionInProgress) exitWith {cutText [localize "STR_EPOCH_ACTIONS_2","PLAIN DOWN"];};
diff --git a/SQF/dayz_code/actions/object_build.sqf b/SQF/dayz_code/actions/object_build.sqf
index bfdd21ff2..a78c34941 100644
--- a/SQF/dayz_code/actions/object_build.sqf
+++ b/SQF/dayz_code/actions/object_build.sqf
@@ -1,4 +1,5 @@
-private ["_status","_array","_object","_items","_classname","_text","_build","_inside","_location","_nearObjects","_dis","_sfx", "_variables"];
+private ["_status","_array","_object","_items","_classname","_text","_build","_inside","_location","_nearObjects","_dis","_sfx","_variables","_ghost","_keepOnSlope","_direction","_passcode"];
+
_array = _this select 3;
_ghost = _array select 0;
diff --git a/SQF/dayz_code/actions/object_disassembly.sqf b/SQF/dayz_code/actions/object_disassembly.sqf
index bc8ecdc2c..a3a5f4edb 100644
--- a/SQF/dayz_code/actions/object_disassembly.sqf
+++ b/SQF/dayz_code/actions/object_disassembly.sqf
@@ -1,6 +1,6 @@
private ["_cursorTarget","_onLadder","_isWater","_alreadyRemoving","_characterID","_objectID","_objectUID","_ownerArray","_dir",
- "_realObjectStillThere","_upgrade","_entry","_parent","_requiredParts","_requiredTools","_model","_toolsOK","_displayname",
- "_whpos","_i","_wh","_object"];
+ "_realObjectStillThere","_upgrade","_entry","_parent","_requiredParts","_requiredTools","_model","_toolsOK","_displayname",
+ "_whpos","_i","_wh","_object","_msg","_vector","_dis","__FILE__","_puid","_variables"];
_cursorTarget = _this select 3;
diff --git a/SQF/dayz_code/actions/object_dismantle.sqf b/SQF/dayz_code/actions/object_dismantle.sqf
index 2142b1837..b51535de9 100644
--- a/SQF/dayz_code/actions/object_dismantle.sqf
+++ b/SQF/dayz_code/actions/object_dismantle.sqf
@@ -1,4 +1,4 @@
-private ["_object","_proceed","_pos","_rndattemps","_limit","_dismantleToo","_pos","_ownerID","_objectID","_objectUID","_playerID","_claimedBy","_tools"];
+private ["_object","_proceed","_rndattemps","_limit","_dismantleToo","_ownerID","_objectID","_objectUID","_playerID","_claimedBy","_tools","_exit","_end","_onLadder","_isWater","_isOk","_counter","_text","_dis","_sfx","_animState","_started","_finished","_isMedic","_holder"];
_object = _this;
_proceed = false;
diff --git a/SQF/dayz_code/actions/object_maintenance.sqf b/SQF/dayz_code/actions/object_maintenance.sqf
index 761510628..544b880d0 100644
--- a/SQF/dayz_code/actions/object_maintenance.sqf
+++ b/SQF/dayz_code/actions/object_maintenance.sqf
@@ -5,7 +5,7 @@
#define MAINTENANCE_NUTRITION_VALUES [20,40,15,0]
-private ["_isMedic","_cursorTarget"];
+private ["_isMedic","_cursorTarget","_item","_classname","_displayname","_requiredTools","_requiredParts","_onLadder","_isWater","_upgradeParts","_startMaintenance","_dis","_sfx","_started","_finished","_animState","_isRefuel"];
_cursorTarget = _this select 3;
diff --git a/SQF/dayz_code/actions/object_upgradeFireplace.sqf b/SQF/dayz_code/actions/object_upgradeFireplace.sqf
index feebe0296..ae4e7818b 100644
--- a/SQF/dayz_code/actions/object_upgradeFireplace.sqf
+++ b/SQF/dayz_code/actions/object_upgradeFireplace.sqf
@@ -9,39 +9,10 @@
};
*/
-private
-[
- "_objclass",
- "_cursorTarget",
- "_item",
- "_classname",
- "_requiredTools",
- "_requiredParts",
- "_upgrade",
- "_upgradeConfig",
- "_upgradeDisplayname",
- "_onLadder",
- "_isWater",
- "_upgradeParts",
- "_startUpgrade",
- "_missingPartsConfig",
- "_textMissingParts",
- "_dis",
- "_sfx",
- "_ownerID",
- "_objectID",
- "_objectUID",
- "_alreadyupgrading",
- "_pos",
- "_dir",
- "_weapons",
- "_magazines",
- "_backpacks",
- "_object",
- "_objWpnTypes",
- "_objWpnQty",
- "_countr"
-];
+private ["_objclass","_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
+"_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis",
+"_sfx","_ownerID","_objectID","_objectUID","_alreadyupgrading","_dir","_weapons","_magazines","_backpacks",
+"_object","_objWpnTypes","_objWpnQty","_countr","_itemName","_msg","_vector"];
_cursorTarget = _this select 0;
diff --git a/SQF/dayz_code/actions/object_upgradeStorage.sqf b/SQF/dayz_code/actions/object_upgradeStorage.sqf
index db25e0b60..2479afd82 100644
--- a/SQF/dayz_code/actions/object_upgradeStorage.sqf
+++ b/SQF/dayz_code/actions/object_upgradeStorage.sqf
@@ -9,39 +9,10 @@
};
*/
-private
-[
- "_objclass",
- "_cursorTarget",
- "_item",
- "_classname",
- "_requiredTools",
- "_requiredParts",
- "_upgrade",
- "_upgradeConfig",
- "_upgradeDisplayname",
- "_onLadder",
- "_isWater",
- "_upgradeParts",
- "_startUpgrade",
- "_missingPartsConfig",
- "_textMissingParts",
- "_dis",
- "_sfx",
- "_ownerID",
- "_objectID",
- "_objectUID",
- "_alreadyupgrading",
- "_pos",
- "_dir",
- "_weapons",
- "_magazines",
- "_backpacks",
- "_object",
- "_objWpnTypes",
- "_objWpnQty",
- "_countr"
-];
+private ["_objclass","_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
+"_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis",
+"_sfx","_ownerID","_objectID","_objectUID","_alreadyupgrading","_dir","_weapons","_magazines","_backpacks","_object",
+"_objWpnTypes","_objWpnQty","_countr","_itemName","_msg","_vector"];
_objclass = _this;
_cursorTarget = _this select 3;
diff --git a/SQF/dayz_code/actions/object_upgradebuilding.sqf b/SQF/dayz_code/actions/object_upgradebuilding.sqf
index de6ee39a6..375a34ff8 100644
--- a/SQF/dayz_code/actions/object_upgradebuilding.sqf
+++ b/SQF/dayz_code/actions/object_upgradebuilding.sqf
@@ -11,6 +11,10 @@
debugged by facoptere@gmail.com
*/
+private ["_cursorTarget","_type","_class","_requiredTools","_requiredParts","_upgradeType","_producedParts","_randomCreate",
+ "_upgradeClass","_msg","_onLadder","_isWater","_ok","_missing","_upgradeParts","_dis","_characterID","_objectID","_objectUID",
+ "_ownerArray","_ownerPasscode","_dir","_vector","_object","_puid","_clanArray","_wh","_variables"];
+
//systemchat str _this;
if (!isnil "faco_object_upgradeBuilding") exitWith { _this call faco_object_upgradeBuilding };
diff --git a/SQF/dayz_code/actions/openGear.sqf b/SQF/dayz_code/actions/openGear.sqf
index 6fb131c1d..82b06c2a7 100644
--- a/SQF/dayz_code/actions/openGear.sqf
+++ b/SQF/dayz_code/actions/openGear.sqf
@@ -1,4 +1,5 @@
private ["_unit","_unconcious","_inVeh","_alive"];
+
call fnc_usec_medic_removeActions;
_unit = _this select 3;
_unconcious = _unit getVariable ["NORRN_unconscious", false];
diff --git a/SQF/dayz_code/actions/pack.sqf b/SQF/dayz_code/actions/pack.sqf
index 261b5e1ca..2754fb372 100644
--- a/SQF/dayz_code/actions/pack.sqf
+++ b/SQF/dayz_code/actions/pack.sqf
@@ -1,4 +1,5 @@
private ["_array","_object","_type"];
+
_array = _this select 3;
_object = _array select 0;
_type = TypeOf(_object);
diff --git a/SQF/dayz_code/actions/player_Constructionitem.sqf b/SQF/dayz_code/actions/player_Constructionitem.sqf
index 97761fff9..b54da290b 100644
--- a/SQF/dayz_code/actions/player_Constructionitem.sqf
+++ b/SQF/dayz_code/actions/player_Constructionitem.sqf
@@ -3,7 +3,7 @@
Please request permission to use/alter from Alby.
*/
-private["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace"];
+private ["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace","_overwrite","_orignalClass","_index","_entry","_avail","_selection","_item","_amount","_itemName","_freeSlots","_slotType","_i","_j"];
disableSerialization;
["close"] call fn_updateCraftUI;
diff --git a/SQF/dayz_code/actions/player_addtoBack.sqf b/SQF/dayz_code/actions/player_addtoBack.sqf
index 9e1a1ef76..7a76a94d0 100644
--- a/SQF/dayz_code/actions/player_addtoBack.sqf
+++ b/SQF/dayz_code/actions/player_addtoBack.sqf
@@ -14,7 +14,7 @@ if (dayZ_OnBack != "") exitWith {closeDialog 0; cutText [format [localize "str_p
call gear_ui_init;
-if (_item in ["ItemHatchet","ItemHatchet_DZE","ItemCrowbar","ItemMachete","ItemFishingPole","ItemSledge"]) then {
+if (_item in ["ItemHatchet","ItemCrowbar","ItemMachete","ItemFishingPole","ItemHatchet_DZE","ItemSledge"]) then {
//free primary slot for new melee (remember item to add after)
switch (_item) do {
case "ItemHatchet": {player removeWeapon "ItemHatchet"; dayz_onBack = "MeleeHatchet";};
diff --git a/SQF/dayz_code/actions/player_attachAttachment.sqf b/SQF/dayz_code/actions/player_attachAttachment.sqf
index a9664bc24..382a25e4b 100644
--- a/SQF/dayz_code/actions/player_attachAttachment.sqf
+++ b/SQF/dayz_code/actions/player_attachAttachment.sqf
@@ -11,15 +11,7 @@
#include "\z\addons\dayz_code\util\Player.hpp"
-private
-[
- "_attachment",
- "_weapon",
- "_config",
- "_newWeapon",
- "_weaponInUse",
- "_muzzle"
-];
+private ["_attachment","_weapon","_config","_newWeapon","_weaponInUse","_muzzle"];
//check if player is on a ladder and if so, exit
if (Player_IsOnLadder()) exitWith
diff --git a/SQF/dayz_code/actions/player_attach_bomb.sqf b/SQF/dayz_code/actions/player_attach_bomb.sqf
index 22513c131..478df4157 100644
--- a/SQF/dayz_code/actions/player_attach_bomb.sqf
+++ b/SQF/dayz_code/actions/player_attach_bomb.sqf
@@ -1,4 +1,5 @@
-private["_theBomb","_vehicle","_curFuel","_newFuel","_timeLeft","_hasToolbox","_hasCarBomb","_dis","_sfx","_alreadyBombed","_hasCrowbar"];
+private ["_theBomb","_vehicle","_curFuel","_newFuel","_timeLeft","_hasToolbox","_hasCarBomb","_dis","_sfx","_alreadyBombed","_hasCrowbar"];
+
_vehicle = _this select 3;
_hasToolbox = "ItemToolbox" in items player;
_hasCrowbar = "ItemCrowbar" in items player;
diff --git a/SQF/dayz_code/actions/player_breakin.sqf b/SQF/dayz_code/actions/player_breakin.sqf
index cdb36ae18..2dd8c00db 100644
--- a/SQF/dayz_code/actions/player_breakin.sqf
+++ b/SQF/dayz_code/actions/player_breakin.sqf
@@ -1,5 +1,5 @@
-private ["_target", "_pos", "_gps", "_vars", "_hasToolbox", "_hasCrowbar", "_limit", "_proceed", "_counter", "_dis", "_sfx", "_roll", "_animState", "_started", "_finished", "_animState", "_isMedic","_isGate"];
-
+private ["_brokein","_isOk","_hasSledgeHammer","_gps","_vars","_hasToolbox","_hasCrowbar","_limit","_proceed","_counter",
+"_dis","_sfx","_roll","_animState","_started","_finished","_isMedic","_isGate"];
_target = _this select 3;
_pos = getPos _target;
_isGate = (typeOf cursorTarget) in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"];
@@ -148,6 +148,6 @@ if (_proceed and _brokein) then {
titleText ["Break in attempt successful.", "PLAIN DOWN", 0.3];
//Open Gate.
- _target animate ["DoorR", 0];
- _target animate ["DoorL", 0];
+ _target animate ["DoorR", 1];
+ _target animate ["DoorL", 1];
};
\ No newline at end of file
diff --git a/SQF/dayz_code/actions/player_buildVanilla.sqf b/SQF/dayz_code/actions/player_buildVanilla.sqf
index 50d4051dd..9dd618a1b 100644
--- a/SQF/dayz_code/actions/player_buildVanilla.sqf
+++ b/SQF/dayz_code/actions/player_buildVanilla.sqf
@@ -1,6 +1,11 @@
// (c) facoptere@gmail.com, licensed to DayZMod for the community
-private ["_classType","_item","_action","_missingTools","_missingItem","_emergingLevel","_isClass","_classname","_requiredTools","_requiredParts ","_ghost","_placement","_text","_onLadder","_isWater","_object","_string","_actionBuildHidden","_getBeams","_o","_offset","_rot","_r","_p","_bn","_bb","_h","_bx","_by","_minElevation","_maxElevation","_insideCheck","_building","_unit","_bbb","_ubb","_check","_min","_max","_myX","_myY","_checkBuildingCollision","_objColliding","_inside","_checkOnRoad","_roadCollide","_checkBeam2Magnet","_a","_beams","_best","_b","_d","_checkNotBuried","_elevation","_position","_delta","_overElevation","_maxplanting","_safeDistance","_dir","_angleRef","_tmp","_actionCancel","_sfx","_actionBuild"];
-
+private ["_classType","_item","_action","_missingTools","_missingItem","_emergingLevel","_isClass","_classname","_requiredTools",
+"_requiredParts","_ghost","_placement","_text","_onLadder","_isWater","_object","_string","_actionBuildHidden","_getBeams",
+"_o","_offset","_rot","_r","_p","_bn","_bb","_h","_bx","_by","_minElevation","_maxElevation","_insideCheck","_building",
+"_unit","_bbb","_ubb","_check","_min","_max","_myX","_myY","_checkBuildingCollision","_objColliding","_inside","_checkOnRoad",
+"_roadCollide","_checkBeam2Magnet","_a","_beams","_best","_b","_d","_checkNotBuried","_elevation","_position","_delta","_overElevation",
+"_maxplanting","_safeDistance","_dir","_angleRef","_tmp","_actionCancel","_sfx","_actionBuild","_byPassChecks","_keepOnSlope","_msg",
+"_ok","_missing","_upgradeParts","_ownerID","_posReference"];
/*
Needs a full rewrite to keep up with the demand of everything we plan to add.
*/
diff --git a/SQF/dayz_code/actions/player_checkConstructionRecipe.sqf b/SQF/dayz_code/actions/player_checkConstructionRecipe.sqf
index f02aae9b3..69e11f596 100644
--- a/SQF/dayz_code/actions/player_checkConstructionRecipe.sqf
+++ b/SQF/dayz_code/actions/player_checkConstructionRecipe.sqf
@@ -3,7 +3,7 @@
Please request permission to use/alter from Alby.
*/
-private ["_items","_counts","_config","_isRecipe","_item","_index","_amount","_count","_entry","_input","_array"];
+private ["_items","_counts","_config","_isRecipe","_item","_index","_amount","_count","_entry","_input","_array","_overwrite","_i","_inputIndex","_inputItems"];
disableSerialization;
_array = _this select 0;
diff --git a/SQF/dayz_code/actions/player_checkRecipe.sqf b/SQF/dayz_code/actions/player_checkRecipe.sqf
index 2f6ff039c..8fa6f18c1 100644
--- a/SQF/dayz_code/actions/player_checkRecipe.sqf
+++ b/SQF/dayz_code/actions/player_checkRecipe.sqf
@@ -3,7 +3,7 @@
Please request permission to use/alter from Alby.
*/
-private ["_items","_counts","_config","_isRecipe","_item","_index","_amount","_count","_entry","_input","_array"];
+private ["_items","_counts","_config","_isRecipe","_item","_index","_amount","_count","_entry","_input","_array","_overwrite","_i","_inputIndex","_inputItems"];
disableSerialization;
_array = _this select 0;
diff --git a/SQF/dayz_code/actions/player_chopWood.sqf b/SQF/dayz_code/actions/player_chopWood.sqf
index bcce46478..9d9df6206 100644
--- a/SQF/dayz_code/actions/player_chopWood.sqf
+++ b/SQF/dayz_code/actions/player_chopWood.sqf
@@ -1,5 +1,5 @@
-private["_item","_result","_dis","_sfx","_num", "_breaking"];
+private ["_item","_result","_dis","_sfx","_num","_breaking","_countOut","_woodCutting","_trees","_findNearestTree","_objInfo","_lenInfo","_objName","_i","_k","_counter","_isOk","_proceed","_animState","_started","_finished","_isMedic","_itemOut"];
//if (!isnil "faco_player_chopWood") exitWith { _this call faco_player_chopWood };
diff --git a/SQF/dayz_code/actions/player_combineMags.sqf b/SQF/dayz_code/actions/player_combineMags.sqf
index 41aa41d72..a20caa9dd 100644
--- a/SQF/dayz_code/actions/player_combineMags.sqf
+++ b/SQF/dayz_code/actions/player_combineMags.sqf
@@ -1,5 +1,4 @@
-private ["_create","_config","_create_magsize","_type","_name","_magCount","_slotstart","_slotend","_dialog","_qty_total_ammo","_control","_mag","_qtynew_create_mags_full","_qtynew_create_ammo_rest","_magFull","_magFullSingular","_magAmmunition"];
-
+private ["_create","_config","_create_magsize","_type","_magCount","_slotstart","_slotend","_dialog","_qty_total_ammo","_control","_mag","_qtynew_create_mags_full","_qtynew_create_ammo_rest","_magFull","_magFullSingular","_magAmmunition","_i"];
disableSerialization;
call gear_ui_init;
closeDialog 0;
diff --git a/SQF/dayz_code/actions/player_consume.sqf b/SQF/dayz_code/actions/player_consume.sqf
index 4f0efa0cd..a88902dfc 100644
--- a/SQF/dayz_code/actions/player_consume.sqf
+++ b/SQF/dayz_code/actions/player_consume.sqf
@@ -11,15 +11,7 @@
#define PILE_SEARCH_RADIUS 2
#define PILE_PLAYER_OFFSET [0,1,0]
-private
-[
- "_cfg",
- "_nutrition",
- "_bloodRegen",
- "_infectionChance",
- "_sound",
- "_output"
-];
+private ["_cfg","_nutrition","_bloodRegen","_infectionChance","_sound","_output","_hungerCount","_thirstCount","_soundDistance"];
_cfg = (ConfigFile >> "CfgMagazines" >> _this);
diff --git a/SQF/dayz_code/actions/player_craftItemVanilla.sqf b/SQF/dayz_code/actions/player_craftItemVanilla.sqf
index 0e9313dc7..3a62dcd0c 100644
--- a/SQF/dayz_code/actions/player_craftItemVanilla.sqf
+++ b/SQF/dayz_code/actions/player_craftItemVanilla.sqf
@@ -10,7 +10,7 @@
failChance = 1;
*/
//diag_log("crafting system");
-private["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace"];
+private ["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace","_classname","_isClass","_onLadder","_hasTools","_avail","_selection","_item","_amount","_itemName","_freeSlots","_slotType","_i","_j","_dis","_sfx"];
//diag_log(str(isnil "r_player_crafting"));
diff --git a/SQF/dayz_code/actions/player_craftitemGUI.sqf b/SQF/dayz_code/actions/player_craftitemGUI.sqf
index 5d31444ca..d02f56015 100644
--- a/SQF/dayz_code/actions/player_craftitemGUI.sqf
+++ b/SQF/dayz_code/actions/player_craftitemGUI.sqf
@@ -3,7 +3,7 @@
Please request permission to use/alter from Alby.
*/
-private["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace"];
+private ["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace","_overwrite","_nearByPile","_index","_entry","_nearByTable","_weaps","_mags","_objMagTypes","_objMagQty","_i","_obj","_return","_inArray","_avail","_selection","_item","_amount","_itemName","_freeSlots","_slotType","_j"];
disableSerialization;
["close"] call fn_updateCraftUI;
diff --git a/SQF/dayz_code/actions/player_createQuiver.sqf b/SQF/dayz_code/actions/player_createQuiver.sqf
index 2a6d38a07..9a32cab52 100644
--- a/SQF/dayz_code/actions/player_createQuiver.sqf
+++ b/SQF/dayz_code/actions/player_createQuiver.sqf
@@ -1,4 +1,4 @@
-private["_qty_arrows","_qty_quivers","_qty_quiverarrows"];
+private ["_qty_arrows","_qty_quivers","_qty_quiverarrows"];
call gear_ui_init;
_qty_arrows = {_x == "WoodenArrow"} count magazines player;
diff --git a/SQF/dayz_code/actions/player_destroyTent.sqf b/SQF/dayz_code/actions/player_destroyTent.sqf
index 6a009abfc..071aa23c6 100644
--- a/SQF/dayz_code/actions/player_destroyTent.sqf
+++ b/SQF/dayz_code/actions/player_destroyTent.sqf
@@ -1,4 +1,4 @@
-private ["_cantype","_emptycan","_intensity","_objectID", "_objectUID"];
+private ["_cantype","_emptycan","_intensity","_objectID","_objectUID","_obj","_fuelArray","_matchArray","_alreadyDestorying","_randomJerryCan","_fireIntensity","_randomBoxMatches","_qtyRemaining","_dis","_sfx"];
//Tent Object
_obj = _this select 3;
diff --git a/SQF/dayz_code/actions/player_emptyContainer.sqf b/SQF/dayz_code/actions/player_emptyContainer.sqf
index 076161cc6..472b4fc00 100644
--- a/SQF/dayz_code/actions/player_emptyContainer.sqf
+++ b/SQF/dayz_code/actions/player_emptyContainer.sqf
@@ -8,15 +8,7 @@
Foxy
*/
-private
-[
- "_cfg",
- "_nutrition",
- "_bloodRegen",
- "_infectionChance",
- "_sound",
- "_output"
-];
+private ["_cfg","_nutrition","_bloodRegen","_infectionChance","_sound","_output"];
_cfg = (ConfigFile >> "CfgMagazines" >> _this);
diff --git a/SQF/dayz_code/actions/player_fillQuiver.sqf b/SQF/dayz_code/actions/player_fillQuiver.sqf
index c8c4cf340..ffb4db1db 100644
--- a/SQF/dayz_code/actions/player_fillQuiver.sqf
+++ b/SQF/dayz_code/actions/player_fillQuiver.sqf
@@ -1,4 +1,4 @@
-private["_qty_arrows","_qty_quivers","_control","_qty_quiverarrows","_qty_quiverfreeslots","_qty_arrows2add"];
+private ["_qty_arrows","_qty_quivers","_control","_qty_quiverarrows","_qty_quiverfreeslots","_qty_arrows2add"];
disableSerialization;
call gear_ui_init;
diff --git a/SQF/dayz_code/actions/player_fixTools.sqf b/SQF/dayz_code/actions/player_fixTools.sqf
index e0b1ea129..cfbe6e026 100644
--- a/SQF/dayz_code/actions/player_fixTools.sqf
+++ b/SQF/dayz_code/actions/player_fixTools.sqf
@@ -1,5 +1,5 @@
//fixHatchet old file
-private ["_tool","_tape","_fixedItem"];
+private ["_tool","_tape","_fixedItem","_config","_dName","_handle"];
_tool = _this;
_config = configFile >> "CfgWeapons" >> _tool;
diff --git a/SQF/dayz_code/actions/player_gather.sqf b/SQF/dayz_code/actions/player_gather.sqf
index 6cccba33a..66fc21f9b 100644
--- a/SQF/dayz_code/actions/player_gather.sqf
+++ b/SQF/dayz_code/actions/player_gather.sqf
@@ -1,4 +1,5 @@
-private ["_plant", "_originalCount"];
+private ["_plant","_originalCount","_xx_leaf","_mags","_weps","_item","_magcounts","_forEachIndex","_wepcounts","_dis","_sfx"];
+
_plant = _this;
if (_plant getVariable["Gathering",false]) exitWith {};
diff --git a/SQF/dayz_code/actions/player_mineStone.sqf b/SQF/dayz_code/actions/player_mineStone.sqf
index 4f7a34bad..090818e9c 100644
--- a/SQF/dayz_code/actions/player_mineStone.sqf
+++ b/SQF/dayz_code/actions/player_mineStone.sqf
@@ -1,5 +1,5 @@
-private ["_item","_result","_dis","_sfx","_num","_breaking","_counter","_rocks","_findNearestRock","_objInfo","_lenInfo","_objName","_i","_k","_countOut","_isOk","_proceed","_animState","_started","_finished","_isMedic","_itemOut","_wpPos","_nearByPile"];
-
+private ["_item","_result","_dis","_sfx","_num","_breaking","_counter","_rocks","_findNearestRock","_objInfo","_lenInfo",
+"_objName","_i","_k","_countOut","_isOk","_proceed","_animState","_started","_finished","_isMedic","_itemOut","_wpPos","_nearByPile"];
_item = _this;
call gear_ui_init;
@@ -38,7 +38,7 @@ if (!isNull _findNearestRock) then {
_countOut = 2 + floor(random 3);
//Remove melee magazines (BIS_fnc_invAdd fix) (add new melee ammo to array if needed)
- {player removeMagazines _x} forEach ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing"];
+ {player removeMagazines _x} forEach ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing","Sledge_Swing"];
// Start stone mining loop
_counter = 0;
@@ -121,7 +121,7 @@ if (!isNull _findNearestRock) then {
};
_isOk = false;
_proceed = true;
- uisleep 1;
+ uiSleep 1;
};
cutText [format[localize "str_mining_progress", _counter,(_countOut - _counter)], "PLAIN DOWN"];
};
@@ -143,6 +143,8 @@ if (!isNull _findNearestRock) then {
case "MeleeCrowbar": {player addMagazine 'Crowbar_Swing';};
case "MeleeMachete": {player addMagazine 'Machete_Swing';};
case "MeleeFishingPole": {player addMagazine 'Fishing_Swing';};
+ case "MeleeHatchet_DZE": {player addMagazine 'Hatchet_Swing';};
+ case "MeleeSledge": {player addMagazine 'Sledge_Swing';};
};
} else {
cutText [localize "str_mining_no_rocks", "PLAIN DOWN"];
diff --git a/SQF/dayz_code/actions/player_operate.sqf b/SQF/dayz_code/actions/player_operate.sqf
index fec82c721..b6706d466 100644
--- a/SQF/dayz_code/actions/player_operate.sqf
+++ b/SQF/dayz_code/actions/player_operate.sqf
@@ -1,4 +1,4 @@
-private ["_target","_type","_fn_Lock","_fn_UnLock","_fn_Open","_fn_Closed"];
+private ["_type","_fn_Lock","_fn_UnLock","_fn_Open","_fn_Closed","_fn_Set","_fn_Lockold","_fn_UnLockold","_fn_BuildLock","_fn_BuildUnLock"];
_target = ((_this select 3) select 0);
_type = ((_this select 3) select 1);
diff --git a/SQF/dayz_code/actions/player_recombineMagazine.sqf b/SQF/dayz_code/actions/player_recombineMagazine.sqf
index cd51b388e..266270f71 100644
--- a/SQF/dayz_code/actions/player_recombineMagazine.sqf
+++ b/SQF/dayz_code/actions/player_recombineMagazine.sqf
@@ -1,4 +1,8 @@
-private ["_item","_config","_consume","_create","_item_ammo","_consume_magsize","_create_magsize","_consume_type","_slotstart","_slotend","_dialog","_qty_total_ammo","_qty_consume_ammo","_qty_create_ammo","_qty_consume_mags","_qty_create_mags","_qty_free_slots","_control","_mag","_qtynew_create_ammo","_qtynew_consume_ammo","_qtynew_create_mags","_qtynew_consume_mags","_qtynew_consume_mags_full","_qtynew_create_mags_full","_qtynew_consume_ammo_rest","_qtynew_create_ammo_rest"];
+private ["_item","_config","_consume","_create","_item_ammo","_consume_magsize","_create_magsize","_consume_type","_slotstart",
+"_slotend","_dialog","_qty_total_ammo","_qty_consume_ammo","_qty_create_ammo","_qty_consume_mags","_qty_create_mags",
+"_qty_free_slots","_control","_mag","_qtynew_create_ammo","_qtynew_consume_ammo","_qtynew_create_mags","_qtynew_consume_mags",
+"_qtynew_consume_mags_full","_qtynew_create_mags_full","_qtynew_consume_ammo_rest","_qtynew_create_ammo_rest","_mags","_i"];
+
disableSerialization;
call gear_ui_init;
diff --git a/SQF/dayz_code/actions/player_reloadMags.sqf b/SQF/dayz_code/actions/player_reloadMags.sqf
index cd51b388e..d717c4432 100644
--- a/SQF/dayz_code/actions/player_reloadMags.sqf
+++ b/SQF/dayz_code/actions/player_reloadMags.sqf
@@ -1,4 +1,8 @@
-private ["_item","_config","_consume","_create","_item_ammo","_consume_magsize","_create_magsize","_consume_type","_slotstart","_slotend","_dialog","_qty_total_ammo","_qty_consume_ammo","_qty_create_ammo","_qty_consume_mags","_qty_create_mags","_qty_free_slots","_control","_mag","_qtynew_create_ammo","_qtynew_consume_ammo","_qtynew_create_mags","_qtynew_consume_mags","_qtynew_consume_mags_full","_qtynew_create_mags_full","_qtynew_consume_ammo_rest","_qtynew_create_ammo_rest"];
+private ["_item","_config","_consume","_create","_item_ammo","_consume_magsize","_create_magsize","_consume_type","_slotstart",
+"_slotend","_dialog","_qty_total_ammo","_qty_consume_ammo","_qty_create_ammo","_qty_consume_mags","_qty_create_mags","_qty_free_slots",
+"_control","_mag","_qtynew_create_ammo","_qtynew_consume_ammo","_qtynew_create_mags","_qtynew_consume_mags","_qtynew_consume_mags_full",
+"_qtynew_create_mags_full","_qtynew_consume_ammo_rest","_qtynew_create_ammo_rest","_mags","_i"];
+
disableSerialization;
call gear_ui_init;
diff --git a/SQF/dayz_code/actions/player_removeAttachment.sqf b/SQF/dayz_code/actions/player_removeAttachment.sqf
index dedec9e50..68ef2f5cf 100644
--- a/SQF/dayz_code/actions/player_removeAttachment.sqf
+++ b/SQF/dayz_code/actions/player_removeAttachment.sqf
@@ -12,15 +12,7 @@
#include "\z\addons\dayz_code\util\Player.hpp"
-private
-[
- "_attachment",
- "_weapon",
- "_newWeapon",
- "_weaponInUse",
- "_newWeaponConfig",
- "_muzzle"
-];
+private ["_attachment","_weapon","_newWeapon","_weaponInUse","_newWeaponConfig","_muzzle"];
//check if player is on a ladder and if so, exit
if (Player_IsOnLadder()) exitWith
diff --git a/SQF/dayz_code/actions/player_sharpen.sqf b/SQF/dayz_code/actions/player_sharpen.sqf
index 3bdf86971..c52d38404 100644
--- a/SQF/dayz_code/actions/player_sharpen.sqf
+++ b/SQF/dayz_code/actions/player_sharpen.sqf
@@ -1,4 +1,4 @@
-private ["_item","_use","_repair","_waterUsed"];
+private ["_item","_use","_repair","_waterUsed","_displayName","_msg"];
//['ItemKnifeBlunt','ItemKnife']
_item = _this select 0; //Item to be sharpened
diff --git a/SQF/dayz_code/actions/player_takeArrow.sqf b/SQF/dayz_code/actions/player_takeArrow.sqf
index 64efa918c..ee6d28330 100644
--- a/SQF/dayz_code/actions/player_takeArrow.sqf
+++ b/SQF/dayz_code/actions/player_takeArrow.sqf
@@ -1,4 +1,4 @@
-private["_qty_quivers","_control","_qty_quiverarrows","_empty","_emptymagslotcount"];
+private ["_qty_quivers","_control","_qty_quiverarrows","_empty","_emptymagslotcount"];
disableSerialization;
call gear_ui_init;
diff --git a/SQF/dayz_code/actions/player_tearClothes.sqf b/SQF/dayz_code/actions/player_tearClothes.sqf
index b6a15c2fa..986a68976 100644
--- a/SQF/dayz_code/actions/player_tearClothes.sqf
+++ b/SQF/dayz_code/actions/player_tearClothes.sqf
@@ -1,4 +1,4 @@
-private ["_skin","_rnd","_rounded","_itemtocreate","_i"];
+private ["_skin","_rnd","_rounded","_itemtocreate","_i","_config","_infoText","_result","_nearByPile","_pile","__FILE__"];
_skin = _this;
_config = configFile >> "CfgMagazines" >> _skin;
diff --git a/SQF/dayz_code/actions/player_useAttchment.sqf b/SQF/dayz_code/actions/player_useAttchment.sqf
index 2162ae770..72f2b55f2 100644
--- a/SQF/dayz_code/actions/player_useAttchment.sqf
+++ b/SQF/dayz_code/actions/player_useAttchment.sqf
@@ -1,4 +1,4 @@
-private["_item","_onLadder","_hasmeditem","_config","_text","_id"];
+private ["_item","_onLadder","_hasmeditem","_config","_text","_removeWeapon","_addWeapon","_hasitem","_display"];
//Old System
diff --git a/SQF/dayz_code/actions/player_wearClothes.sqf b/SQF/dayz_code/actions/player_wearClothes.sqf
index 8c3dce8de..f38dfc44c 100644
--- a/SQF/dayz_code/actions/player_wearClothes.sqf
+++ b/SQF/dayz_code/actions/player_wearClothes.sqf
@@ -1,37 +1,35 @@
-/*
-_item spawn player_wearClothes;
-Added Female skin changes - DayZ Epoch - vbawol
-*/
-private ["_item","_onLadder","_hasclothesitem","_config","_text","_myModel","_itemNew","_currentSex","_newSex","_model","_playerNear"];
-
-if (_this in DZE_RestrictSkins) exitWith { cutText [format[(localize "str_epoch_player_315"),_this], "PLAIN DOWN"] };
-
+if (_this in DZE_RestrictSkins) exitWith { cutText [format[localize "str_epoch_player_315",_this], "PLAIN DOWN"] };
if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_83","PLAIN DOWN"]};
DZE_ActionInProgress = true;
+/*
+_item call player_wearClothes;
+Added Female skin changes - DayZ Epoch - vbawol
+*/
+private ["_item","_onLadder","_hasclothesitem","_config","_text","_isFemale","_myModel","_humanity","_isBandit","_isHero",
+"_itemNew","_model","_skinToArray","_finalArray","_skinToModel"];
_item = _this;
call gear_ui_init;
r_action_count = 0; //reset for strange glitch
-_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
-if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21","PLAIN DOWN"]};
+_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
+if (_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"]; DZE_ActionInProgress = false;};
_hasclothesitem = _this in magazines player;
_config = configFile >> "CfgMagazines";
_text = getText (_config >> _item >> "displayName");
-if (!_hasclothesitem) exitWith { DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"wear"] , "PLAIN DOWN"]};
-
-if (vehicle player != player) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_85","PLAIN DOWN"]};
+if (!_hasclothesitem) exitWith {cutText [format [localize "str_player_31",_text,localize "str_player_31_wear"] , "PLAIN DOWN"]; DZE_ActionInProgress = false;};
+if (vehicle player != player) exitWith {cutText [localize "str_player_fail_wear1", "PLAIN DOWN"]; DZE_ActionInProgress = false;};
//if (!isNull (unitBackpack player)) exitWith {DZE_ActionInProgress = false; cutText [localize "STR_EPOCH_ACTIONS_9","PLAIN DOWN"]};
-
if ("CSGAS" in (magazines player)) exitWith {DZE_ActionInProgress = false; cutText [localize "STR_EPOCH_ACTIONS_10","PLAIN DOWN"]};
_myModel = (typeOf player);
+_humanity = player getVariable ["humanity",0];
+_isBandit = _humanity < -2000;
+_isHero = _humanity > 5000;
_itemNew = "Skin_" + _myModel;
-//diag_log ("Debug Clothes: model In: " + str(_itemNew) + " Out: " + str(_item));
-
if ( (isClass(_config >> _itemNew)) ) then {
if ( (isClass(_config >> _item)) ) then {
// Current sex of player skin
diff --git a/SQF/dayz_code/actions/playerstats/determine_humanity_fnc.sqf b/SQF/dayz_code/actions/playerstats/determine_humanity_fnc.sqf
index 4cffba6ce..1b0757f43 100644
--- a/SQF/dayz_code/actions/playerstats/determine_humanity_fnc.sqf
+++ b/SQF/dayz_code/actions/playerstats/determine_humanity_fnc.sqf
@@ -4,8 +4,7 @@
//********************************************************************************************************************/
-private ["_h_human_disp","_top_value","_bot_value","_card_details","_h","_blank","_bandit_pic","_bandit_pic","_b_human_disp","_b_spades_top_suit","_b_spades_bot_suit","_b_clubs_top_suit","_b_clubs_bot_suit","_survivor_pic","_survivor_pic","_s_human_disp","_s_top_joker_b","_s_bot_joker_b","_s_top_joker_r","_s_bot_joker_r","_hero_pic","_hero_pic","_h_hearts_top_suit","_h_hearts_bot_suit","_h_diamonds_top_suit","_h_diamonds_bot_suit"];
-_h = (_this select 0) / 37037.037037;
+private ["_h_human_disp","_top_value","_bot_value","_card_details","_h","_blank","_bandit_pic","_b_human_disp","_b_spades_top_suit","_b_spades_bot_suit","_b_clubs_top_suit","_b_clubs_bot_suit","_survivor_pic","_s_human_disp","_s_top_joker_b","_s_bot_joker_b","_s_top_joker_r","_s_bot_joker_r","_hero_pic","_h_hearts_top_suit","_h_hearts_bot_suit","_h_diamonds_top_suit","_h_diamonds_bot_suit","_pl_pic","_humanity_readout","_top_joker","_bot_joker","_top_suit","_bot_suit"];_h = (_this select 0) / 37037.037037;
// we need to return these
/*
diff --git a/SQF/dayz_code/actions/playerstats/epeen_setText_journal.sqf b/SQF/dayz_code/actions/playerstats/epeen_setText_journal.sqf
index 8c222fdf8..a649b2998 100644
--- a/SQF/dayz_code/actions/playerstats/epeen_setText_journal.sqf
+++ b/SQF/dayz_code/actions/playerstats/epeen_setText_journal.sqf
@@ -1,5 +1,4 @@
-private ["_ys","_ms","_ds","_b","_2","_6","_7","_8","_9","_10","_str_left_text","_1","_3","_4","_5","_blood_in_pack","_blood_in_inv","_mag_arr","_backpack","_11","_mags_for_weap","_mssv_cnt","_weapon","_config"];
-
+private ["_ys","_ms","_ds","_b","_2","_6","_7","_8","_9","_10","_str_left_text","_1","_3","_4","_5","_blood_in_pack","_blood_in_inv","_mag_arr","_backpack","_11","_mags_for_weap","_mssv_cnt","_weapon","_config","_survivors","_moon","_spawnselection","_disabledTemperature"];
_survivors = playersNumber west;
_str_left_text = "
@@ -251,9 +250,9 @@ _disabledTemperature = switch (dayz_temperature_override) do {
// left page
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1800) ctrlSetStructuredText parseText format ["
+ Survival Type: %14
Health: %1
-
Hunger: %2%
Thirst: %3%
@@ -287,7 +286,8 @@ _disabledTemperature = switch (dayz_temperature_override) do {
(round diag_fps),
(round diag_fpsmin),
(_moon),
- (_disabledTemperature)
+ (_disabledTemperature),
+ (dayz_presets)
];
// right page - blank until humanity is checked
diff --git a/SQF/dayz_code/actions/call_zombies.sqf b/SQF/dayz_code/actions/pzombie/call_zombies.sqf
similarity index 100%
rename from SQF/dayz_code/actions/call_zombies.sqf
rename to SQF/dayz_code/actions/pzombie/call_zombies.sqf
diff --git a/SQF/dayz_code/actions/pzombie/pz_feed.sqf b/SQF/dayz_code/actions/pzombie/pz_feed.sqf
index 5227f0192..9396eba9c 100644
--- a/SQF/dayz_code/actions/pzombie/pz_feed.sqf
+++ b/SQF/dayz_code/actions/pzombie/pz_feed.sqf
@@ -7,7 +7,7 @@ disableSerialization;
player removeAction s_player_butcher;
s_player_butcher = 1;
-if(!(alive _item)) then {
+if !(alive _item) then {
_rnd = (round(random 4)) + 1;
_move = "ZombieFeed" + str(_rnd);
@@ -68,7 +68,7 @@ if(!(alive _item)) then {
[player,"eat",0,false] call dayz_zombieSpeak;
- // todo: dump loot on ground && then remove
+ // todo: dump loot on ground and then remove
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
diff --git a/SQF/dayz_code/actions/remove.sqf b/SQF/dayz_code/actions/remove.sqf
index 1cecd23cb..3ee0f3655 100644
--- a/SQF/dayz_code/actions/remove.sqf
+++ b/SQF/dayz_code/actions/remove.sqf
@@ -1,19 +1,16 @@
+if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_88","PLAIN DOWN"];};
+DZE_ActionInProgress = true;
/*
delete object from db with extra waiting by [VB]AWOL
parameters: _obj
*/
private ["_activatingPlayer","_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_friendlies","_nearestPole","_ownerID","_refundpart","_isWreck","_findNearestPoles","_findNearestPole","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular"];
-if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_88","PLAIN DOWN"];};
-DZE_ActionInProgress = true;
-
player removeAction s_player_deleteBuild;
s_player_deleteBuild = 1;
_obj = _this select 3;
-
_activatingPlayer = player;
-
_objOwnerID = _obj getVariable["CharacterID","0"];
_isOwnerOfObj = (_objOwnerID == dayz_characterID);
@@ -248,3 +245,5 @@ if (_proceed) then {
};
DZE_ActionInProgress = false;
s_player_deleteBuild = -1;
+
+_obj
\ No newline at end of file
diff --git a/SQF/dayz_code/actions/repair_cancel.sqf b/SQF/dayz_code/actions/repair_cancel.sqf
index 6a527ef04..7cd6319c5 100644
--- a/SQF/dayz_code/actions/repair_cancel.sqf
+++ b/SQF/dayz_code/actions/repair_cancel.sqf
@@ -1,4 +1,3 @@
-private [];
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
s_player_repair_crtl = -1;
dayz_myCursorTarget = objNull;
\ No newline at end of file
diff --git a/SQF/dayz_code/actions/tent_pitch.sqf b/SQF/dayz_code/actions/tent_pitch.sqf
new file mode 100644
index 000000000..721738f1c
--- /dev/null
+++ b/SQF/dayz_code/actions/tent_pitch.sqf
@@ -0,0 +1,104 @@
+private ["_item","_config","_text","_booleans","_worldspace","_dir","_location","_dis","_sfx","_tent","_classname","_object","_boundingBox","_maxPoint","_actionBuild","_actionCancel"];
+/*
+private ["_item", "_config", "_text", "_booleans", "_worldspace", "_dir", "_location", "_dis", "_sfx", "_tent"];
+
+call gear_ui_init;
+
+_item = _this;
+
+_config = configFile >> "CfgMagazines" >> _item;
+_text = getText (_config >> "displayName");
+_classname = getText (_config >> "tentmodel");
+
+//diag_log ("Classname: "+str(_classname));
+//diag_log ("Item: "+str(_item));
+
+if (r_action_count != 1) exitWith { cutText [localize "str_player_actionslimit", "PLAIN DOWN"]; };
+
+// item is missing or tools are missing
+if ((!(_item IN magazines player))) exitWith {
+ r_action_count = 0;
+ cutText [format [localize "str_player_31",_text,localize "str_player_31_pitch"] , "PLAIN DOWN"];
+};
+
+_booleans = []; //testonLadder, testSea, testPond, testBuilding, testSlope, testDistance
+
+ //remove tentbag
+ player removeMagazine _item;
+ //_dir = _worldspace select 0;
+ //_location = _worldspace select 1;
+
+ //wait a bit
+ //player playActionNow "Medic";
+ sleep 1;
+ // tent location may not be in front of player
+ //player setDir _dir;
+ //player setPosATL (getPosATL player);
+
+ _dis=20;
+ _sfx = "tentunpack";
+
+ //sleep 5;
+
+ cutText [localize "str_player_build_rotate", "PLAIN DOWN"];
+ _location = getMarkerpos "respawn_west";
+ _object = createVehicle [_classname, _location, [], 0, "NONE"];
+
+ // Attach item
+ _boundingBox = boundingBox _object;
+ _maxPoint = ((_boundingBox select 1) select 0) max ((_boundingBox select 1) select 1);
+ _object setPosATL [getPosATL _object select 0, getPosATL _object select 1, 0.01];
+ _object attachTo [player, [0, _maxPoint + 1, 0.3]];
+
+ //Vars
+ player setVariable ["constructionObject", _object];
+ _object setVariable ["characterID",dayz_characterID,true];
+
+ //Actions
+ _actionBuild = player addAction [localize "str_player_build_complete", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _item, _classname, _text, true, _booleans, _dis, _sfx], 1, true];
+ _actionCancel = player addAction [localize "str_player_build_cancel", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _item, _classname, _text, false, _booleans, _dis, _sfx], 1, true];
+
+ sleep 0.01;
+
+ while {!isNull (player getVariable "constructionObject")} do {
+ if (vehicle player != player) then {
+ player action ["eject", vehicle player];
+ };
+
+ if (speed player > 10 or speed player <= -8) then {
+ cutText [localize "str_player_build_movingfast", "PLAIN DOWN"];
+ player playMove "amovpercmstpssurwnondnon";
+ };
+
+ sleep 0.2;
+
+ if (!alive player) then {
+ [[],[],[],[_object, _item, _classname, _text, false, _booleans, _dis, _sfx]] call object_build;
+ };
+ };
+
+ player removeAction _actionBuild;
+ player removeAction _actionCancel;
+*/
+/*
+ sleep 5;
+
+ _tent = createVehicle ["TentStorage", getMarkerpos "respawn_west", [], 0, "CAN_COLLIDE"];
+ _tent setDir _dir;
+ _tent setPos _location; // follow terrain slope (works above sea level)
+ player reveal _tent;
+ _location = getPosATL _tent;
+
+ _tent setVariable ["characterID",dayz_characterID,true];
+ PVDZ_obj_Publish = [dayz_characterID,_tent,[_dir,_location],_classname];
+ publicVariableServer "PVDZ_obj_Publish";
+
+ cutText [localize "str_success_tent_pitch", "PLAIN DOWN"];
+ sleep 1;
+ r_action_count = 0;
+
+} else {
+ r_action_count = 0;
+ cutText [localize "str_fail_tent_pitch", "PLAIN DOWN"];
+};
+*/
diff --git a/SQF/dayz_code/actions/unpack.sqf b/SQF/dayz_code/actions/unpack.sqf
deleted file mode 100644
index 63bb7a4ff..000000000
--- a/SQF/dayz_code/actions/unpack.sqf
+++ /dev/null
@@ -1,15 +0,0 @@
-
-private ["_array","_location","_dir","_classname","_weapon"];
-_array = _this select 3;
-_location = player modeltoworld [0,1,0];
-_dir = getDir player;
-_classname = _array select 0;
-removeBackpack player;
-player playActionNow "Medic";
-uiSleep 8;
-player removeAction r_player_action_bag;
-r_action_bag = false;
-_weapon = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
-_weapon setDir _dir;
-//_weapon setpos _location;
-player reveal _weapon;
\ No newline at end of file
diff --git a/SQF/dayz_code/actions/veh_seatActions.sqf b/SQF/dayz_code/actions/veh_seatActions.sqf
index a188a68f7..a79a09b56 100644
--- a/SQF/dayz_code/actions/veh_seatActions.sqf
+++ b/SQF/dayz_code/actions/veh_seatActions.sqf
@@ -1,6 +1,6 @@
/*
- Created exclusively for ArmA2:OA - DayZMod && DayZ Epoch. Script by icomrade.
- permission is required to use, alter &&/|| distribute from the author || project leader.
+ Created exclusively for ArmA2:OA - DayZMod and DayZ Epoch. Script by icomrade.
+ permission is required to use, alter and/or distribute from the author or project leader.
*/
private ["_array","_count","_action","_driver","_vehicle","_vehicleType","_emptySeat","_emptyGun"];
_array = _this select 3;
diff --git a/SQF/dayz_code/actions/water_fill.sqf b/SQF/dayz_code/actions/water_fill.sqf
index 4febd1fd3..d8bf79b07 100644
--- a/SQF/dayz_code/actions/water_fill.sqf
+++ b/SQF/dayz_code/actions/water_fill.sqf
@@ -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"];
-};
\ No newline at end of file
+}
+foreach magazines player;
+
+if (_filled > 0)
+then { (format [localize "str_player_01", _filled]) call dayz_rollingMessages; }
+else { (localize "str_player_02") call dayz_rollingMessages; };
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/fn_checkAndRemoveItems.sqf b/SQF/dayz_code/compile/fn_checkAndRemoveItems.sqf
deleted file mode 100644
index a09f42be1..000000000
--- a/SQF/dayz_code/compile/fn_checkAndRemoveItems.sqf
+++ /dev/null
@@ -1,7 +0,0 @@
-private ["_items","_b"];
-_items = _this;
-_b = _items call player_checkItems;
-if (_b) then {
- _b = _items call player_removeItems;
-};
-_b
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/fn_damageActions.sqf b/SQF/dayz_code/compile/fn_damageActions.sqf
index 972140f27..d6cdc73bb 100644
--- a/SQF/dayz_code/compile/fn_damageActions.sqf
+++ b/SQF/dayz_code/compile/fn_damageActions.sqf
@@ -1,5 +1,5 @@
scriptName "Functions\misc\fn_damageActions.sqf";
-
+if (DZE_ActionInProgress) exitWith {};
#include "\z\addons\dayz_code\util\array.hpp";
/***********************************************************
@@ -7,8 +7,8 @@ scriptName "Functions\misc\fn_damageActions.sqf";
- Function
- [] call fnc_usec_damageActions;
************************************************************/
-if (DZE_ActionInProgress) exitWith {};
-private ["_action","_weaponName","_turret","_weapons","_assignedRole","_driver","_action1","_action2","_vehicle","_unit","_vehType","_vehClose","_hasVehicle","_unconscious","_lowBlood","_injured","_inPain","_legsBroke","_armsBroke","_charID","_friendlies","_playerMagazines","_hasBandage","_hasEpi","_hasMorphine","_hasPainkillers","_unconscious_crew","_patients","_crew","_menClose","_hasPatient","_inVehicle","_isClose","_transfuse"];
+
+private ["_menClose","_hasPatient","_vehicle","_inVehicle","_isClose","_assignedRole","_driver","_action","_turret","_weapons","_weaponName","_crew","_unconscious_crew","_patients","_vehType","_unit","_antibiotics","_bloodBags","_unconscious","_lowBlood","_injured","_hasSepsis","_inPain","_legsBroke","_armsBroke","_infected","_hasBandage","_hasSepsisBandage","_hasEpi","_hasMorphine","_hasSplint","_hasPainkillers","_hasEmptyBag","_hasTester","_hasAntibiotics","_hasBloodBag","_vehClose","_hasVehicle","_action1","_action2","_action3","_y","_playerMagazines"];
_menClose = cursorTarget;
_hasPatient = alive _menClose;
@@ -135,7 +135,7 @@ if (isPlayer cursorTarget) then {
if (_hasPatient) then {
//Allow player to drag
- if (_unconscious) then {
+ if(_unconscious) then {
r_action = true;
_action1 = _unit addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\openGear.sqf",_unit, 0, true, true];
_action2 = _unit addAction [localize "str_actions_medical_01", "\z\addons\dayz_code\medical\drag.sqf",_unit, 0, true, true];
@@ -161,43 +161,43 @@ if (isPlayer cursorTarget) then {
r_player_actions set [count r_player_actions,_action];
};
//Allow player to bandage
- if (_injured && _hasBandage) then {
+ if(_injured && _hasBandage) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemBandage"], 0, true, true, "", "'ItemBandage' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Sepsis
- if (_hasSepsis && _hasSepsisBandage) then {
+ if(_hasSepsis && _hasSepsisBandage) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemSepsisBandage"], 0, true, true, "", "'ItemBandage' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Epinephrine
- if (_unconscious && _hasEpi) then {
+ if(_unconscious && _hasEpi) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_05", "\z\addons\dayz_code\medical\epinephrine.sqf",[_unit], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Morphine
- if ((_legsBroke or _armsBroke) && _hasMorphine) then {
+ if((_legsBroke or _armsBroke) && _hasMorphine) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"ItemMorphine"], 0, true, true, "", "'ItemMorphine' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give equip_woodensplint
- if ((_legsBroke or _armsBroke) && _hasSplint) then {
+ if((_legsBroke or _armsBroke) && _hasSplint) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_06_splint", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"equip_woodensplint"], 0, true, true, "", "'equip_woodensplint' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Painkillers
- if (_inPain && _hasPainkillers) then {
+ if(_inPain && _hasPainkillers) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true, "", "'ItemPainkiller' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to transfuse blood
- if (_lowBlood && _hasBloodBag) then {
+ if(_lowBlood && _hasBloodBag) then {
_transfuse = if (DZE_UseBloodTypes) then {"\z\addons\dayz_code\medical\transfusion.sqf"} else {"\z\addons\dayz_code\medical\transfusion_NoBloodTypes.sqf"};
r_action = true;
_action = _unit addAction [localize "str_actions_medical_08",_transfuse,[_unit], 0, true, true];
diff --git a/SQF/dayz_code/compile/fn_dropItem.sqf b/SQF/dayz_code/compile/fn_dropItem.sqf
index cdc4084d7..d1219b42e 100644
--- a/SQF/dayz_code/compile/fn_dropItem.sqf
+++ b/SQF/dayz_code/compile/fn_dropItem.sqf
@@ -3,28 +3,36 @@ private ["_item","_pos","_nearByPile","_holder"];
//Radius to search for holder
#define PILE_SEARCH_RADIUS 2
//Location to offset the holder
-#define PILE_PLAYER_OFFSET [0,0,0]
+#define PILE_OFFSET [0,0,0]
_item = _this;
_holder = objNull;
//Lets get the location of the player in the world
-_pos = player modeltoWorld PILE_PLAYER_OFFSET;
+_pos = player modeltoWorld PILE_OFFSET;
//Check if a holder is close by the player.
_nearByPile= nearestObjects [_pos, ["WeaponHolder","WeaponHolderBase"],PILE_SEARCH_RADIUS];
if (count _nearByPile == 0) then {
+ //No weapon holders found in the radius, spawn a new one
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"];
} else {
+ //Found a near by weapon holder lets select it.
_holder = _nearByPile select 0;
+
+ //check to make sure the player can see the selected weapon holder.
+ _objects = lineIntersectsWith [(_holder modeltoWorld PILE_OFFSET), _pos, player, _holder, true];
+
+ //Can you see the current selected weapon holder
+ if ((count _objects) > 0) then {
+ //Unable to see the current selected weapon holder within the radius lets create a new one.
+ _holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"];
+ };
};
-//Add the item to the newly created holder or to the new holder.
+//Add the item to the holder or to the newly created holder.
_holder addMagazineCargoGlobal [_item,1];
-//Make sure the holder spawns behind the physical location of the player
-_holder setPosATL (player modeltoWorld PILE_PLAYER_OFFSET);
-
//Revel the item
player reveal _holder;
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/fn_inAngleSector.sqf b/SQF/dayz_code/compile/fn_inAngleSector.sqf
index a1474a3b7..8116b3b7a 100644
--- a/SQF/dayz_code/compile/fn_inAngleSector.sqf
+++ b/SQF/dayz_code/compile/fn_inAngleSector.sqf
@@ -6,8 +6,8 @@
//
/*
Returns true if lies within the sector defined by ,
- && . Use this function to determine if
- a position lies within a certain angle from another position (ie the ).
+ and . Use this function to determine if
+ a position lies within a certain angle from another position (ie the ).
Example:
[position player,getdir player,30,position enemy_tank] call BIS_fnc_inAngleSector
will return true if the vehicle named enemy_tank is within 30 degrees of where the player is pointing.
@@ -15,19 +15,17 @@
// Revision History:
// 09/01/08 0.1 - First cut VBS2
//------------------
-
-
-private["_dir1","_dir2","_dir3","_small","_large","_x","_y","_r"];
+private["_r","_dir1"];
_r = false;
_small = (_this select 1) - ((_this select 2) / 2);
_large = (_this select 1) + ((_this select 2) / 2);
-_x = ((_this select 3) select 0) - ((_this select 0) select 0);
-_y = ((_this select 3) select 1) - ((_this select 0) select 1);
+_xpos = ((_this select 3) select 0) - ((_this select 0) select 0);
+_ypos = ((_this select 3) select 1) - ((_this select 0) select 1);
-_dir1 = _x atan2 _y;
+_dir1 = _xpos atan2 _ypos;
if (_dir1 < 0) then {_dir1 = _dir1 + 360};
diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf
index 83eb230e7..69abbba9c 100644
--- a/SQF/dayz_code/compile/fn_selfActions.sqf
+++ b/SQF/dayz_code/compile/fn_selfActions.sqf
@@ -190,7 +190,7 @@ if (DZE_NameTags > 0) then {
if (_isPZombie) then {
if (s_player_callzombies < 0) then {
- s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false];
+ s_player_callzombies = player addAction [localize "STR_EPOCH_ACTIONS_RAISEHORDE", "\z\addons\dayz_code\actions\pzombie\call_zombies.sqf",player, 5, true, false];
};
if (DZE_PZATTACK) then {
call pz_attack;
@@ -949,7 +949,7 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
//Dog
if (_isDog && {_hasRawMeat} && {_isAlive} && {_ownerID == "0"} && {player getVariable ["dogID",0] == 0}) then {
if (s_player_tamedog < 0) then {
- s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true];
+ s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\dog\tame_dog.sqf", _cursorTarget, 1, false, true];
};
} else {
player removeAction s_player_tamedog;
diff --git a/SQF/dayz_code/compile/fn_sunRise.sqf b/SQF/dayz_code/compile/fn_sunRise.sqf
index e2ad65bd6..d7b4614f8 100644
--- a/SQF/dayz_code/compile/fn_sunRise.sqf
+++ b/SQF/dayz_code/compile/fn_sunRise.sqf
@@ -10,11 +10,12 @@
Returns:
Sun's rise in hours, in the same format as engine's [daytime] command (16.5 == 16:30)
To obtain sun's set, just subtract the result from 24.
-
+
Reference:
http://forums.bistudio.com/showthread.php?107476-How-do-I-detect-sundown-sunrise
*/
-private ["_lat","_day","_hour","_daytime"];
+private["_daytime"];
+
_lat = -1 * getNumber(configFile >> "CfgWorlds" >> worldName >> "latitude");
_day = 360 * (dateToNumber date);
_hour = acos ((24 * sin(_lat) * cos(_day)) / ((12 * cos(_day) - 78) * cos(_lat)));
diff --git a/SQF/dayz_code/compile/fnc_MapEventHandler.sqf b/SQF/dayz_code/compile/fnc_MapEventHandler.sqf
deleted file mode 100644
index 93d3798fe..000000000
--- a/SQF/dayz_code/compile/fnc_MapEventHandler.sqf
+++ /dev/null
@@ -1,22 +0,0 @@
-private ["_markerstr","_class","_name","_type","_position","_radiusA","_radiusB","_maptype","_config"];
-
-if ("ItemMap_Debug" in items player) then {
- // _world = toUpper(worldName);
- _maptype = ["NameCityCapital","NameCity","NameVillage","NameLocal"];
_config = configFile >> "CfgWorlds" >> worldName >> "Names";
- for "_i" from 0 to (count _config -1) do {
- _class = _config select _i; //Returns a conif
_name = getText (_class >> "name");
_type = getText (_class >> "type");
_position = getArray (_class >> "position");
_radiusA = getNumber (_class >> "radiusA");
_radiusB = getNumber (_class >> "radiusB");
- if (_type in _maptype) then {
- //diag_log(format["Config Type, Name: %1 / Type: %2 / Position: %3, Passed",_name,_type,_position]);
- // _rnd = random 1;
- // _chance = 0.6;
- // if (_rnd < _chance) then {
- _markerstr = createMarkerLocal ["markername_" +str (_name), _position];
- _markerstr setMarkerTextLocal _name;
- _markerstr setMarkerColorLocal "ColorGreen";
- _markerstr setMarkerShapeLocal "ELLIPSE";
- _markerstr setMarkerBrushLocal "Grid";
- _markerstr setMarkerSizeLocal [_radiusA, _radiusB];
- // };
- };
- };
-};
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/local_eventKill.sqf b/SQF/dayz_code/compile/local_eventKill.sqf
index 40ef24982..ff8108191 100644
--- a/SQF/dayz_code/compile/local_eventKill.sqf
+++ b/SQF/dayz_code/compile/local_eventKill.sqf
@@ -1,19 +1,14 @@
//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
-private ["_zed","_killer","_kills","_array","_type","_humanity"];
+private["_killer"];
-_array = _this select 0;
-_zed = _array select 0;
-_killer = _array select 1;
-_type = _this select 1;
+_array = _this select 0;
+_zed = _array select 0;
+_killer = _array select 1;
+_type = _this select 1;
if (local _zed) then {
_kills = _killer getVariable[_type,0];
_killer setVariable[_type,(_kills + 1),true];
-
- //increase players humanity when zed killed
- _humanity = _killer getVariable["humanity",0];
- _humanity = _humanity + 5;
- _killer setVariable["humanity",_humanity,true];
};
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/local_gutObject.sqf b/SQF/dayz_code/compile/local_gutObject.sqf
index b2d77ca26..f11a1529e 100644
--- a/SQF/dayz_code/compile/local_gutObject.sqf
+++ b/SQF/dayz_code/compile/local_gutObject.sqf
@@ -40,4 +40,4 @@ if (local _animalbody) then {
deleteVehicle _body;
true
};
-};
\ No newline at end of file
+};
diff --git a/SQF/dayz_code/compile/object_cargoCheck.sqf b/SQF/dayz_code/compile/object_cargoCheck.sqf
index d6984fe85..ba1fa0077 100644
--- a/SQF/dayz_code/compile/object_cargoCheck.sqf
+++ b/SQF/dayz_code/compile/object_cargoCheck.sqf
@@ -1,21 +1,22 @@
-private ["_currentObjects","_currentTypes","_currentQty","_previousTypes","_previousQty","_serial","_itemVal","_itemQty","_oldSerial","_oldQty","_change","_checkObjects"];
//_newObjects = [_previous,weapons player] call player_weaponCheck;
-_currentObjects = _this select 0;
-_checkObjects = _this select 1;
+private["_change","_currentTypes","_currentQty","_previousTypes","_previousQty","_serial"];
+
+_currentObjects = _this select 0;
+_checkObjects = _this select 1;
_change = false;
if (count _currentObjects > 1) then {
- _currentTypes = _currentObjects select 0;
- _currentQty = _currentObjects select 1;
+ _currentTypes = _currentObjects select 0;
+ _currentQty = _currentObjects select 1;
} else {
_currentTypes = [];
_currentQty = [];
};
if (count _checkObjects > 1) then {
- _previousTypes = _checkObjects select 0;
- _previousQty = _checkObjects select 1;
+ _previousTypes = _checkObjects select 0;
+ _previousQty = _checkObjects select 1;
} else {
_previousTypes = [];
_previousQty = [];
@@ -27,31 +28,31 @@ _serial = 0;
{
_itemVal = _x;
_itemQty = _currentQty select _serial;
-
- _oldSerial = _previousTypes find _itemVal;
+
+ _oldSerial = _previousTypes find _itemVal;
_oldQty = 0;
if (_oldSerial >= 0) then {
- _oldQty = _previousQty select _oldSerial;
+ _oldQty = _previousQty select _oldSerial;
};
if (_itemQty != _oldQty) then {_change = true};
-
+
_serial = _serial + 1;
-} count _currentTypes;
+} forEach _currentTypes;
//Review old loadout
_serial = 0;
{
_itemVal = _x;
_itemQty = _previousQty select _serial;
-
- _oldSerial = _currentTypes find _itemVal;
+
+ _oldSerial = _currentTypes find _itemVal;
_oldQty = 0;
if (_oldSerial >= 0) then {
- _oldQty = _currentQty select _oldSerial;
+ _oldQty = _currentQty select _oldSerial;
};
if (_itemQty != _oldQty) then {_change = true};
-
- _serial = _serial + 1;
-} count _previousTypes;
-_change
\ No newline at end of file
+ _serial = _serial + 1;
+} forEach _previousTypes;
+
+_change;
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/object_getHit.sqf b/SQF/dayz_code/compile/object_getHit.sqf
index 14a116a4c..6fa31178b 100644
--- a/SQF/dayz_code/compile/object_getHit.sqf
+++ b/SQF/dayz_code/compile/object_getHit.sqf
@@ -1,7 +1,8 @@
-private["_unit","_hp","_selection","_strH","_dam"];
-_unit = _this select 0;
-_hp = _this select 1;
+_unit = _this select 0;
+_hp = _this select 1;
+
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _unit) >> "HitPoints" >> _hp >> "name");
_strH = "hit_" + (_selection);
_dam = _unit getVariable [_strH,0];
+
_dam
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/object_roadFlare.sqf b/SQF/dayz_code/compile/object_roadFlare.sqf
index 8ab051705..dfbf7b14e 100644
--- a/SQF/dayz_code/compile/object_roadFlare.sqf
+++ b/SQF/dayz_code/compile/object_roadFlare.sqf
@@ -1,4 +1,3 @@
-private ["_flare","_lightArea","_lightSpark","_type","_color"];
_flare = _this select 0;
_type = _this select 1;
//_sfx = objNull;
@@ -12,14 +11,14 @@ if (!isNull _flare) then {
_lightArea setLightAmbient [0.2,0.01,0.01];
_lightArea setLightBrightness 0.2;
_lightArea lightAttachObject [_flare, [0,0,0]];
-
+
//Spark Light
_lightSpark = "#lightpoint" createVehicleLocal (getPosATL _flare);
_lightSpark setLightColor [0.1,0.1,0.1];
_lightSpark setLightAmbient [0.05,0.05,0.05];
_lightSpark setLightBrightness 0.05;
_lightSpark lightAttachObject [_flare, [0,0,0]];
-
+
while {alive _flare} do {
_lightArea setLightAmbient [((random 0.2) + 0.2),0.01,0.01];
//_lightArea setLightColor [((random 0.1) + 0.1),0.005,0.005];
@@ -30,7 +29,7 @@ if (!isNull _flare) then {
};
case 1: {
//Spark Light
- _color = getArray(configFile >> "cfgAmmo" >> (typeOf _flare) >> "lightColor");
+ _color = getArray(configFile >> "cfgAmmo" >> (typeOf _flare) >> "lightColor");
_lightSpark = "#lightpoint" createVehicleLocal (getPosATL _flare);
_lightSpark setLightColor _color;
_lightSpark setLightAmbient _color;
diff --git a/SQF/dayz_code/compile/object_setHit.sqf b/SQF/dayz_code/compile/object_setHit.sqf
index 0ea6a11c7..4c820fc85 100644
--- a/SQF/dayz_code/compile/object_setHit.sqf
+++ b/SQF/dayz_code/compile/object_setHit.sqf
@@ -1,13 +1,16 @@
-private ["_unit","_selection","_strH","_dam","_damage"];
-_unit = _this select 0;
-_selection = _this select 1;
-_damage = _this select 2;
+// this function name is "object_setHit", but it's used to set character limb damages back during a skin change (player_humanityMorph.sqf)
+
+private ["_damage"];
+_unit = _this select 0;
+_selection = _this select 1;
+_damage = _this select 2;
if (_selection != "") then {
_strH = "hit_" + (_selection);
_dam = _unit getVariable [_strH,0];
_unit setVariable [_strH,(_dam + _damage)];
if (_selection in USEC_MinorWounds) then {
_unit setHit[_selection,(_dam + _damage)];
+ diag_log(format["%1: %2 setHit %3 %4", __FILE__, _unit, _selection, (_dam + _damage)]);
};
};
-_damage;
\ No newline at end of file
+_damage
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/object_setHitLocal.sqf b/SQF/dayz_code/compile/object_setHitLocal.sqf
index b532d3383..e80535b00 100644
--- a/SQF/dayz_code/compile/object_setHitLocal.sqf
+++ b/SQF/dayz_code/compile/object_setHitLocal.sqf
@@ -1,16 +1,16 @@
-private ["_unit","_selection","_strH","_dam","_total","_damage"];
-_unit = _this select 0;
-_selection = _this select 1;
-_damage = _this select 2;
-if ((_selection != "")) then {
- _strH = "hit_" + (_selection);
- _dam = _unit getVariable [_strH,0];
- _total = (_dam + _damage);
- if (_total > 1) then {
- _total = 1;
- };
- _unit setVariable [_strH,_total];
-} else {
- _damage = 0;
-};
-_damage;
\ No newline at end of file
+// private["_unit","_selection","_strH","_dam","_total"];
+// _unit = _this select 0;
+// _selection = _this select 1;
+// _damage = _this select 2;
+// if ((_selection != "")) then {
+// _strH = "hit_" + (_selection);
+// _dam = _unit getVariable [_strH,0];
+// _total = (_dam + _damage);
+// if (_total > 1) then {
+// _total = 1;
+// };
+// _unit setVariable [_strH,_total];
+// } else {
+// _damage = 0;
+// };
+// _damage
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/object_updatePosition.sqf b/SQF/dayz_code/compile/object_updatePosition.sqf
index 23136e8c4..b017b2ae8 100644
--- a/SQF/dayz_code/compile/object_updatePosition.sqf
+++ b/SQF/dayz_code/compile/object_updatePosition.sqf
@@ -1,10 +1,10 @@
-private["_object","_updateObj"];
-//check if can pitch here
-_object = _this;
-
-if (_object getVariable ["ObjectID",0] > 0) then {
- _updateObj = _object getVariable["update",[false,false,false]];
- _updateObj set [1,true];
- _object setVariable ["update",_updateObj,true];
- _object setVariable ["position",(getPosATL _object),true];
-};
\ No newline at end of file
+// private["_object","_updateObj"];
+// //check if can pitch here
+// _object = _this;
+//
+// if (_object getVariable ["ObjectID",0] > 0) then {
+// _updateObj = _object getVariable["update",[false,false,false]];
+// _updateObj set [1,true];
+// _object setVariable ["update",_updateObj,true];
+// _object setVariable ["position",(getPosATL _object),true];
+// };
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/player_animalCheck.sqf b/SQF/dayz_code/compile/player_animalCheck.sqf
index 5dd3bb584..fc9af9789 100644
--- a/SQF/dayz_code/compile/player_animalCheck.sqf
+++ b/SQF/dayz_code/compile/player_animalCheck.sqf
@@ -1,47 +1,58 @@
-private ["_animalssupported","_type","_agent","_favouritezones","_randrefpoint","_PosList","_PosSelect","_Pos","_list"];
-_list = (getposATL player) nearEntities [["CAAnimalBase"],dayz_animalDistance];
-if ((count _list) < dayz_maxAnimals) then {
- _animalssupported = ["Chicken","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit","Dog"];
- _type = (_animalssupported select (floor(random(count _animalssupported))));
- Switch (_type) do {
- case "Cow" : {
- _animalssupported = ["Cow01","Cow02","Cow03","Cow04","Cow01_EP1"];
- _type = (_animalssupported select (floor(random(count _animalssupported))));
+private ["_type"];
+_list = getposATL player nearEntities [["CAAnimalBase"],dayz_animalDistance];
+
+if ((count _list < dayz_maxAnimals) and (dayz_currentGlobalAnimals < dayz_maxGlobalAnimals)) then {
+ //Find where animal likes
+ _amount = (dayz_maxAnimals - (count _list)) min (dayz_maxGlobalAnimals - dayz_currentGlobalAnimals);
+ for "_i" from 0 to _amount do {
+ _animalssupported = ["Chicken","Chicken","Chicken","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit","Dog"];
+ _type = (_animalssupported select floor(random(count _animalssupported)));
+ switch (_type) do {
+ case "Cow" : {
+ _animalssupported = ["Cow01","Cow02","Cow03","Cow04","Cow01_EP1"];
+ _type = (_animalssupported select (floor(random(count _animalssupported))));
+ };
+ case "Goat" : {
+ _animalssupported = ["Goat01_EP1","Goat02_EP1","Goat"];
+ _type = (_animalssupported select (floor(random(count _animalssupported))));
+ };
+ case "Sheep" : {
+ _animalssupported = ["Sheep","Sheep02_EP1","Sheep01_EP1"];
+ _type = (_animalssupported select (floor(random(count _animalssupported))));
+ };
+ case "Chicken" : {
+ _animalssupported = ["Hen","Cock"];
+ _type = (_animalssupported select (floor(random(count _animalssupported))));
+ };
+ case "Dog" : {
+ _animalssupported = ["DZ_Fin","DZ_Pastor"];
+ _type = (_animalssupported select (floor(random(count _animalssupported))));
+ };
};
- case "Goat" : {
- _animalssupported = ["Goat01_EP1","Goat02_EP1","Goat"];
- _type = (_animalssupported select (floor(random(count _animalssupported))));
- };
- case "Sheep" : {
- _animalssupported = ["Sheep","Sheep02_EP1","Sheep01_EP1"];
- _type = (_animalssupported select (floor(random(count _animalssupported))));
- };
- case "Chicken" : {
- _animalssupported = ["Hen","Cock"];
- _type = (_animalssupported select (floor(random(count _animalssupported))));
- };
- case "Dog" : {
- _animalssupported = ["DZ_Fin","DZ_Pastor"];
- _type = (_animalssupported select (floor(random(count _animalssupported))));
+ _root = configFile >> "CfgVehicles" >> _type;
+ _favouritezones = getText ( _root >> "favouritezones");
+ //_randrefpoint = [position player, 10, dayz_animalDistance, 1, 0, 50, 0] call BIS_fnc_findSafePos;
+ _randrefpoint = getposATL player;
+ _PosList = selectbestplaces [_randrefpoint,dayz_animalDistance,_favouritezones,10,5];
+ _PosSelect = _PosList select (floor random (count _PosList));
+ _Pos = _PosSelect select 0;
+ _list = _Pos nearEntities [["CAAnimalBase","Man"],50];
+
+
+ if (player distance _Pos < dayz_animalDistance and NOT surfaceIsWater _Pos and (count _list <= 1)) then {
+ if (_type == "DZ_Pastor") then {
+ _agent = createAgent [_type, _Pos, [], 0, "NONE"];
+ } else {
+ _agent = createAgent [_type, _Pos, [], 0, "FORM"];
+ };
+
+ //Disable simulation
+ PVDZ_Server_Simulation = [_agent, false];
+ publicVariableServer "PVDZ_Server_Simulation";
+
+ _agent setpos _Pos;
+ _id = [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
};
+ uiSleep 1;
};
- _favouritezones = getText (configFile >> "CfgVehicles" >> _type >> "favouritezones");
- _randrefpoint = getposATL player;
- _PosList = selectBestPlaces [_randrefpoint,dayz_animalDistance,_favouritezones,10,5];
- _PosSelect = _PosList select (floor(random(count _PosList)));
- _Pos = _PosSelect select 0;
- _list = _Pos nearEntities [["CAAnimalBase","Man"],50];
-
-
- if (((player distance _Pos) < dayz_animalDistance) && {!(surfaceIsWater _Pos)} && {(count _list) <= 1}) then {
- if (_type == "DZ_Pastor") then { _agent = createAgent [_type, _Pos, [], 0, "NONE"]; } else { _agent = createAgent [_type, _Pos, [], 0, "FORM"]; };
-
- //Disable simulation
- PVDZ_Server_Simulation = [_agent, false];
- publicVariableServer "PVDZ_Server_Simulation";
-
- _agent setPos _Pos;
- _id = [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
- };
- uiSleep 1;
-};
+};
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/player_crossbowBolt.sqf b/SQF/dayz_code/compile/player_crossbowBolt.sqf
index c66dfde84..a9c658b9d 100644
--- a/SQF/dayz_code/compile/player_crossbowBolt.sqf
+++ b/SQF/dayz_code/compile/player_crossbowBolt.sqf
@@ -1,30 +1,23 @@
-private ["_unit","_ammo","_distance","_weapon","_projectile","_vUp","_endPos","_dir","_height","_bolt","_hitArray","_hitObject","_hitSelection","_config","_hitMemoryPt","_variation","_val","_doLoop","_countr","_magazine"];
-_unit = _this select 0;
-_weapon = _this select 1;
-_ammo = _this select 4;
-_magazine = _this select 5;
-_projectile = _this select 6;
+private ["_endPos","_vUp","_doLoop","_hitArray","_countr","_hitObject","_hitSelection","_config","_hitMemoryPt","_variation","_val","_dir","_bolt","_obj","_unit","_ammo","_projectile","_height"];
+_obj = _this select 0;
+_unit = _obj select 0;
+//_weapon = _obj select 1;
+_ammo = _obj select 4;
+//_magazine = _obj select 5;
+_projectile = _obj select 6;
-_projectile = nearestObject [_unit, _ammo];
+_projectile = nearestObject [_unit,_ammo];
_vUp = vectorUp _projectile;
_endPos = getPosATL _projectile;
_dir = 0;
-if (_magazine == "Quiver") then {
- _ammo = player ammo "Crossbow_DZ";
- if (_ammo > 0) then {
- player removeMagazines "Quiver";
- player addMagazine ["Quiver", _ammo];
- };
-};
-
while {alive _projectile} do {
_endPos = getPosATL _projectile;
_vUp = vectorUp _projectile;
- uiSleep 0.01;
+ sleep 0.01;
};
-_distance = _unit distance _endPos;
+//_distance = _unit distance _endPos;
_height = _endPos select 2;
_doLoop = true;
_countr = 0;
@@ -34,27 +27,27 @@ if (_height < 100) then {
_bolt setPosATL _endPos;
_bolt setDir (getDir _unit);
_bolt setVectorUp _vUp;
-
+
_hitArray = _unit getVariable["firedHit",[]];
while {_doLoop} do {
_hitArray = _unit getVariable["firedHit",[]];
if (count _hitArray > 0) then {_doLoop = false};
if (_countr > 50) then {_doLoop = false};
_countr = _countr + 1;
- uiSleep 0.1;
+ sleep 0.1;
};
-
+
if (count _hitArray > 0) then {
_hitObject = _hitArray select 0;
_hitSelection = _hitArray select 1;
_config = configFile >> "cfgBody" >> _hitSelection;
- _hitMemoryPt = getText(_config >> "memoryPoint");
- _variation = getNumber(_config >> "variation");
+ _hitMemoryPt = getText(_config >> "memoryPoint");
+ _variation = getNumber(_config >> "variation");
_val = [((random (_variation * 2)) - _variation),((random (_variation * 2)) - _variation),((random (_variation * 2)) - _variation)];
_bolt attachTo [_hitObject,_val,_hitMemoryPt];
_dir = ([_hitObject,_unit] call BIS_fnc_relativeDirTo) + 180;
_bolt setDir (_dir);
- [_bolt] call FNC_GetSetPos;
+ _bolt setPos (getPosATL _bolt);
_unit setVariable["firedHit",[]];
_unit setVariable["firedDamage",0,true];
};
diff --git a/SQF/dayz_code/compile/player_projectileNear.sqf b/SQF/dayz_code/compile/player_projectileNear.sqf
index 079ad6504..6215a64a5 100644
--- a/SQF/dayz_code/compile/player_projectileNear.sqf
+++ b/SQF/dayz_code/compile/player_projectileNear.sqf
@@ -1,49 +1,49 @@
-private ["_unit","_projectile","_isInCombat","_currentNear","_projectilespeed","_projectflight","_listNear","_callCount","_nearVehicle"];
-_unit = _this select 0;
-_projectile = _this select 6;
+private ["_currentNear","_listNear","_callCount"];
+_unit = _this select 0;
+_projectile = _this select 6;
-//diag_log ("0");
+diag_log ("0");
//_isInComat = _unit getVariable["startcombattimer",0];
-//diag_log ("Bullit Speed: " +str(Speed _projectile));
-//diag_log ("Bullit Velocity: " +str(velocity _projectile));
+diag_log ("Bullit Speed: " +str(Speed _projectile));
+diag_log ("Bullit Velocity: " +str(velocity _projectile));
_listNear = [];
_callCount = 0;
//approx 1020 meters
-while {(alive _projectile) && !(isNull _projectile) && _callCount < 85;} do {
+while {(alive _projectile) && !(isNull _projectile) && (_callCount < 85)} do {
_projectilespeed = Speed _projectile;
_projectflight = (((_projectilespeed / 60) * 1000));
if (_projectflight > 0) then {
uiSleep (12 / (_projectflight));
};
- if (alive _projectile && !(isNull _projectile)) then {_currentNear = ([_projectile] call FNC_GetPos) nearEntities [["CAManBase","AllVehicles"],15];};
+ if (alive _projectile && !(isNull _projectile)) then {_currentNear = (getPosATL _projectile) nearEntities [["CAManBase","AllVehicles"],15];};
_listNear = _listNear + _currentNear;
_callCount = _callCount + 1;
};
-//diag_log ("2");
+diag_log ("2");
{
_nearVehicle = _x;
_listNear = _listNear - [_x];
- //diag_log ("3");
+ diag_log ("3");
if (isPlayer _nearVehicle) then {
_isInCombat = _nearVehicle getVariable["startcombattimer",0];
- if ((alive _nearVehicle) && _isInCombat == 0) then {
+ if ((alive _nearVehicle) and _isInCombat == 0) then {
_nearVehicle setVariable["startcombattimer", 1];
- //diag_log("Now in Combat (Player): " + name _unit);
+ diag_log("Now in Combat (Player): " + name _unit);
};
};
if (_nearVehicle isKindOf "AllVehicles") then {
{
_isInCombat = _x getVariable["startcombattimer",0];
- if (isPlayer _x && _isInCombat == 0 && alive _x) then {
+ if (isPlayer _x and _isInCombat == 0 and alive _x) then {
_x setVariable["startcombattimer", 1];
- //diag_log("Now in Combat (Crew): " + name _x);
+ diag_log("Now in Combat (Crew): " + name _x);
};
} forEach (crew _nearVehicle);
};
diff --git a/SQF/dayz_code/compile/player_throwObject.sqf b/SQF/dayz_code/compile/player_throwObject.sqf
index b2083864c..116e85f00 100644
--- a/SQF/dayz_code/compile/player_throwObject.sqf
+++ b/SQF/dayz_code/compile/player_throwObject.sqf
@@ -28,4 +28,4 @@ if (_ammo isKindOf "RoadFlare") then {
_distance = if ((daytime < (24 - dayz_sunRise)) && (daytime > dayz_sunRise)) then {30} else {60};
};
-[_unit,_distance,false,_endPos] call player_alertZombies;
\ No newline at end of file
+[_unit,_distance,false,_endPos] call player_alertZombies;
diff --git a/SQF/dayz_code/compile/player_weaponCheck.sqf b/SQF/dayz_code/compile/player_weaponCheck.sqf
index 38d7a83eb..554251e04 100644
--- a/SQF/dayz_code/compile/player_weaponCheck.sqf
+++ b/SQF/dayz_code/compile/player_weaponCheck.sqf
@@ -1,7 +1,7 @@
-private ["_currentObjects","_newObjects","_checkObjects","_type","_qtyNow","_qtyBefore","_change"];
+private ["_newObjects","_change"];
//_newObjects = [_previous,weapons player] call player_weaponCheck;
-_currentObjects = _this select 0;
-_checkObjects = _this select 1;
+_currentObjects = _this select 0;
+_checkObjects = _this select 1;
_change = false;
@@ -10,8 +10,8 @@ _newObjects = [];
{
if (!(_x in _newObjects)) then {
_type = _x;
- _qtyNow = {_x == _type} count _checkObjects;
- _qtyBefore = {_x == _type} count _currentObjects;
+ _qtyNow = {_x == _type} count _checkObjects;
+ _qtyBefore = {_x == _type} count _currentObjects;
if (_qtyNow != _qtyBefore) then {
_change = true;
};
@@ -24,8 +24,8 @@ _newObjects = [];
{
if (!(_x in _newObjects)) then {
_type = _x;
- _qtyNow = {_x == _type} count _checkObjects;
- _qtyBefore = {_x == _type} count _currentObjects;
+ _qtyNow = {_x == _type} count _checkObjects;
+ _qtyBefore = {_x == _type} count _currentObjects;
if (_qtyNow != _qtyBefore) then {
_change = true;
};
@@ -33,4 +33,4 @@ _newObjects = [];
};
} forEach _checkObjects;
-_change;
\ No newline at end of file
+_change
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/player_weaponFiredNear.sqf b/SQF/dayz_code/compile/player_weaponFiredNear.sqf
index 2d806233e..a9490c0d2 100644
--- a/SQF/dayz_code/compile/player_weaponFiredNear.sqf
+++ b/SQF/dayz_code/compile/player_weaponFiredNear.sqf
@@ -91,4 +91,4 @@ private ["_handled"];
};
};
};
- //Launcher Handler
\ No newline at end of file
+ //Launcher Handler
diff --git a/SQF/dayz_code/compile/player_zombieAttack.sqf b/SQF/dayz_code/compile/player_zombieAttack.sqf
index 51c4afddf..e1485ecff 100644
--- a/SQF/dayz_code/compile/player_zombieAttack.sqf
+++ b/SQF/dayz_code/compile/player_zombieAttack.sqf
@@ -330,4 +330,4 @@ if (_isVehicle) then {
}; // fi player by foot
};
//_stop = diag_tickTime;
-//diag_log format ["%2 Execution Time: %1",_stop - _start, __FILE__];
\ No newline at end of file
+//diag_log format ["%2 Execution Time: %1",_stop - _start, __FILE__];
diff --git a/SQF/dayz_code/compile/player_zombieCheck.sqf b/SQF/dayz_code/compile/player_zombieCheck.sqf
index 841861e91..fd72651dd 100644
--- a/SQF/dayz_code/compile/player_zombieCheck.sqf
+++ b/SQF/dayz_code/compile/player_zombieCheck.sqf
@@ -139,4 +139,4 @@ if (_attacked) then {
};
// return true if attacked or near. if so, player_monitor will perform its ridiculous 'while true' loop faster.
-(_attacked OR _near)
\ No newline at end of file
+(_attacked OR _near)
diff --git a/SQF/dayz_code/compile/ui_gear_sound.sqf b/SQF/dayz_code/compile/ui_gear_sound.sqf
index b9d751bf3..3f67659f3 100644
--- a/SQF/dayz_code/compile/ui_gear_sound.sqf
+++ b/SQF/dayz_code/compile/ui_gear_sound.sqf
@@ -16,7 +16,7 @@ if( (!isNull cursorTarget) && (player distance cursorTarget < 5) && (vehicle pla
};
};
-/*Player doesn't have a cursor target, || its too far away, || they are in a vehicle.
+/*Player doesn't have a cursor target, or its too far away, or they are in a vehicle.
else{
if ( (vehicle player != player) && (vehicle player isKindOf "AllVehicles") ) then {
//Player is in a vehicle, placeholder for vehicle trunk sounds(if added)
diff --git a/SQF/dayz_code/compile/veh_handleKilled.sqf b/SQF/dayz_code/compile/veh_handleKilled.sqf
index f443d2b3d..481ed6c80 100644
--- a/SQF/dayz_code/compile/veh_handleKilled.sqf
+++ b/SQF/dayz_code/compile/veh_handleKilled.sqf
@@ -1,24 +1,14 @@
-private["_unit","_hitPoints","_selection","_killer"];
-
_unit = _this select 0;
-_killer = _this select 1;
-
-_hitPoints = _unit call vehicle_getHitpoints;
-{
- _selection = getText (configFile >> "CfgVehicles" >> (typeof _unit) >> "HitPoints" >> _x >> "name");
- _unit setVariable [_selection, 1, true];
-} count _hitPoints;
+//_killer = _this select 1;
// ask server to set global damage to 1, save to the hive
-if (isServer) then {
- [_unit, "killed"] call server_updateObject;
-} else {
- if (DZE_Debug_Damage && ((!isPlayer _unit) || ((isPlayer _unit) && (vehicle _unit != _unit) && (_unit != _killer)))) then {
- PVDZ_veh_Save = [_unit, "killed",_killer];
+if (local _unit) then {
+ if (isServer) then {
+ [_unit, "killed"] call server_updateObject;
} else {
PVDZ_veh_Save = [_unit, "killed"];
+ publicVariableServer "PVDZ_veh_Save";
};
- publicVariableServer "PVDZ_veh_Save";
};
// everyone removes their EH for this vehicle
diff --git a/SQF/dayz_code/compile/zombie_findTarget.sqf b/SQF/dayz_code/compile/zombie_findTarget.sqf
deleted file mode 100644
index ad09401f3..000000000
--- a/SQF/dayz_code/compile/zombie_findTarget.sqf
+++ /dev/null
@@ -1,79 +0,0 @@
-private ["_group","_target","_targetMen","_targetDis","_c","_man","_manDis","_targets","_lead","_rnd","_assigned","_fires","_range"];
-_group = _this;
-_target = objNull;
-_lead = leader _group;
-_targetMen = [];
-_targetDis = [];
-_range = 500;
-
-_assigned = _group getVariable ["targets",[]];
-{
- _group reveal [_x,4];
-} count _assigned;
-
-//Find targets
-_targets = _lead nearTargets _range;
-{
- private["_obj","_dis"];
- _obj = _x select 4;
- _dis = _obj distance _lead;
- if (_obj isKindOf "Man" && ((speed _obj) < 15)) then {
- if (!(_obj isKindOf "zZombie_Base") && !(_obj in _targetMen)) then {
- //process man targets
- _targetMen set [count _targetMen,_obj];
- _targetDis set [count _targetDis,_dis];
- };
- };
-} count _targets;
-
-//Search for fires
-if (count _targetMen == 0) then {
- _fires = nearestObjects [_lead,["Land_Fire","SmokeShell","Generator_DZ"],_range];
- {
- private["_dis"];
- _dis = _x distance _lead;
- if ((_dis < _range) && !(_x in _targetMen)) then {
- _rnd = random 1;
- if (_rnd < 0.5) then {
- if ((inflamed _x) || (_x isKindOf "SmokeShell")) then {
- _targetMen set [count _targetMen,_x];
- _targetDis set [count _targetDis,_dis];
- } else {
- if (_x isKindOf "Generator_DZ") then {
- if (alive _x && (_x getVariable ["GeneratorRunning", false])) then {
- _targetMen set [count _targetMen,_x];
- _targetDis set [count _targetDis,_dis];
- };
- };
- };
- };
- };
- } count _fires;
-};
-
-//Find best target
-if (count _targetMen > 0) then {
- _man = _targetMen select 0;
- _manDis = _targetDis select 0;
- _c = 0;
- {
- private["_dis"];
- _dis = _targetDis select _c;
- if (_dis < _manDis) then {
- _man = _x;
- _manDis = _dis;
- };
- if (_x isKindOf "SmokeShell") then {
- _man = _x;
- _manDis = _dis;
- };
- _c = _c + 1;
- } count _targetMen;
- _target = _man;
-};
-
-//Check if too far
-if (_manDis > _range) then {
- _target = objNull;
-};
-_target;
\ No newline at end of file
diff --git a/SQF/dayz_code/compile/zombie_loiter.sqf b/SQF/dayz_code/compile/zombie_loiter.sqf
index 29e4b32b8..73e8f1ab7 100644
--- a/SQF/dayz_code/compile/zombie_loiter.sqf
+++ b/SQF/dayz_code/compile/zombie_loiter.sqf
@@ -1,29 +1,18 @@
-private ["_unit","_originalPos","_pos","_chance","_playerpos"];
+private["_unit","_originalPos","_pos"];
_unit = _this select 0;
_originalPos = _this select 1;
_pos = getPosATL _unit;
-_playerpos = ([player] call FNC_GetPos);
if (count _this > 2) then {
_pos = _this select 2;
} else {
//_unit enableAI "MOVE";
//_unit enableAI "ANIM";
-
- _chance = round(random 12);
- if ((_chance % 4) == 0) then {
- //_Offset = [0,0,0];
- //_playerworldPos = _playerpos modelToWorld _Offset;
- _pos = [_playerpos,30,120,4,0,5,0] call BIS_fnc_findSafePos;
- } else {
- _pos = [_originalPos,10,90,4,0,5,0] call BIS_fnc_findSafePos;
- };
-
- if (_unit distance player > 250) then {
- _pos = [_playerpos,120,200,4,0,5,0] call BIS_fnc_findSafePos;
- };
+ //_pos = [_originalPos,10,90,4,0,5,0] call BIS_fnc_findSafePos;
+ _pos = [_originalPos,10,(10 - (random (90 * 2))),0] call fn_selectRandomLocation;
};
+/*
if(isNull group _unit) then {
_unit moveTo _pos;
} else {
@@ -31,3 +20,6 @@ if(isNull group _unit) then {
};
_unit forceSpeed 2;
_unit setVariable ["myDest",_pos];
+*/
+
+_pos
diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf
index 58213e075..e33342c99 100644
--- a/SQF/dayz_code/init/compiles.sqf
+++ b/SQF/dayz_code/init/compiles.sqf
@@ -176,7 +176,6 @@ if (!isDedicated) then {
player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";
player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf";
player_vaultPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\vault_pitch.sqf";
- player_checkAndRemoveItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_checkAndRemoveItems.sqf";
pz_attack = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf";
dayz_losChance = {
diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf
index c3efc3acc..97f562468 100644
--- a/SQF/dayz_code/init/variables.sqf
+++ b/SQF/dayz_code/init/variables.sqf
@@ -519,7 +519,6 @@ s_player_parts = [];
if(isNil "DayZ_UseSteamID") then {DayZ_UseSteamID = true;};
if(isNil "DZE_SelfTransfuse") then {DZE_SelfTransfuse = false;};
if(isNil "DZE_GodModeBase") then {DZE_GodModeBase = false;};
-if(isNil "DZE_Debug_Damage") then {DZE_Debug_Damage = true;};
if(isNil "DZE_TRADER_SPAWNMODE") then {DZE_TRADER_SPAWNMODE = false;};
if(isNil "dayz_paraSpawn") then {dayz_paraSpawn = false;};
if(isNil "DZE_BuildingLimit") then {DZE_BuildingLimit = 150;};
diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml
index 77e08366e..c9fcd1d48 100644
--- a/SQF/dayz_code/stringtable.xml
+++ b/SQF/dayz_code/stringtable.xml
@@ -7417,6 +7417,7 @@
No puedes cambiar de ropa mientras estás en un vehículo
Vous ne pouvez pas vous changer dans un véhicule
Nelze se převléci, když jste ve vozidle.
+ Je kunt je niet omkleden in een voertuig
Currently Female Characters cannot change to this skin. This will change in a future update.
diff --git a/SQF/dayz_epoch_b/stringtable.xml b/SQF/dayz_epoch_b/stringtable.xml
index ef08eddc8..3a15a6353 100644
--- a/SQF/dayz_epoch_b/stringtable.xml
+++ b/SQF/dayz_epoch_b/stringtable.xml
@@ -824,15 +824,6 @@
\n\nImpossible de changer de vêtements près d'un autre joueur.
\n\nNemůžete si změnit oblečení, když je poblíž další hráč.
-
- \n\nYou may not change clothes while in a vehicle
- \n\nSie können Ihre Kleidung nicht innerhalb eines Fahrzeuges wechseln
- \n\nВы не можете переодеваться, находясь в транспорте
-
- \n\nJe kunt je niet omkleden in een voertuig
- \n\nVous ne devriez pas changer de vêtements à bord d'un véhicule
- \n\nNemůžete si změnit oblečení, pokud jste v autě.
-
\n\nYou cannot wear a skin of the opposite sex.
\n\nSie können nicht die Kleidung vom anderen Geschlecht tragen.
@@ -1148,15 +1139,6 @@
%1 est rempli(e) à %2 pourcents de sa capacité.
%1 je naplněno do %2 procent kapacity.
-
- You have filled %1 with fuel.
- Sie haben %1 mit Kraftstoff befüllt.
- Вы заполнили %1 топливом.
-
- Je hebt %1 met brandsfof gevuld.
- Vous avez rempli %1 avec du carburant.
- Naplnili jste %1 palivem.
-
\n\nThis building needs a %1 within %2 meters
\n\nDieses Gebäude benötitgt ein(e) %1 innerhalb von %2 Metern.