From 2046a9d14ff2985686a5d2fc4c13e58371ac26b0 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Wed, 6 Nov 2013 20:15:03 -0600 Subject: [PATCH 1/7] moved melee ammo sync with 1.8 --- SQF/dayz_code/Configs/CfgMagazines.hpp | 29 +---- SQF/dayz_code/Configs/cfgAmmo.hpp | 142 +++++++++++++++++++++++-- 2 files changed, 138 insertions(+), 33 deletions(-) diff --git a/SQF/dayz_code/Configs/CfgMagazines.hpp b/SQF/dayz_code/Configs/CfgMagazines.hpp index 580b3117a..5eb71ada4 100644 --- a/SQF/dayz_code/Configs/CfgMagazines.hpp +++ b/SQF/dayz_code/Configs/CfgMagazines.hpp @@ -4635,32 +4635,9 @@ class CfgMagazines { displayName = $STR_ITEMWATERBOTTLEBOILED_CODE_NAME; descriptionShort = $STR_ITEMWATERBOTTLEBOILED_CODE_DESC; }; - class Hatchet_Swing; - class Machete_Swing : Hatchet_Swing { - displayName = "Machete"; - displayNameMagazine = "Machete"; - shortNameMagazine = "Machete"; - ammo = "Machete_Swing_Ammo"; - }; - class Fishing_Swing : Hatchet_Swing { - displayName = "Fishing"; - displayNameMagazine = "Fishing"; - shortNameMagazine = "Fishing"; - ammo = "Fishing_Swing_Ammo"; - }; - class sledge_swing : Hatchet_Swing { - displayName = "Sledge"; - displayNameMagazine = "Sledge"; - shortNameMagazine = "Sledge"; - ammo = "Sledge_Swing_Ammo"; - }; - // Inventory Placeholder - class DummyItem : Hatchet_Swing { - displayName = "Dummy"; - displayNameMagazine = "Dummy"; - shortNameMagazine = "Dummy"; - ammo = "Dummy_Swing_Ammo"; - }; + + #include "CfgMagazines\MeleeSwing.hpp" + // class HandGrenade; class ItemTrashToiletpaper : HandGrenade { scope = public; diff --git a/SQF/dayz_code/Configs/cfgAmmo.hpp b/SQF/dayz_code/Configs/cfgAmmo.hpp index 0f18d303b..6385e901b 100644 --- a/SQF/dayz_code/Configs/cfgAmmo.hpp +++ b/SQF/dayz_code/Configs/cfgAmmo.hpp @@ -1,4 +1,73 @@ class CfgAmmo { + class BulletBase; +//as50 + class B_127x99_Ball: BulletBase { + airfriction = -0.00068; + airlock = 1; + audiblefire = 22; + caliber = 2.07; + cartridge = "FxCartridge_127"; + cost = 20; + hit = 0; //26 + indirecthit = 0; + indirecthitrange = 0; + model = "\ca\Weapons\Data\bullettracer\tracer_red"; + tracerendtime = 2.3; + tracerscale = 1.5; + tracerstarttime = 0.1; + visiblefire = 22; + visiblefiretime = 3; + }; + class B_127x99_Ball_noTracer: B_127x99_Ball { + airfriction = -0.0005; + audiblefire = 22; + muzzleeffect = "BIS_Effects_HeavySniper"; + tracercolor[] = {0, 0, 0, 0}; + tracercolorr[] = {0, 0, 0, 0}; + tracerstarttime = -1; + visiblefire = 20; + visiblefiretime = 3; + }; + class B_127x99_Ball_noTracer_BAF: B_127x99_Ball_noTracer { + hit = 0; //56 + indirecthit = 0; + indirecthitrange = 0; + }; +//mak + class B_9x18_Ball : BulletBase { + airfriction = -0.002751; + audiblefire = 15; + caliber = 0.33; + cartridge = "FxCartridge_9mm"; + cost = 5; + hit = 6; + typicalspeed = 350; + visiblefire = 15; + }; +//macSD + class B_9x18_SD : B_9x18_Ball { + airfriction = -0.001893; + audiblefire = 0.035; + cost = 5; + hit = 6; + typicalspeed = 310; + visiblefire = 0.035; + visiblefiretime = 2; + }; +//1911 + class B_45ACP_Ball : BulletBase { + airfriction = -0.0013522; + audiblefire = 16; + caliber = 0.33; //33 + cartridge = "FxCartridge_9mm"; + cost = 5; + hit = 9; + indirecthit = 0; + indirecthitrange = 0; + typicalspeed = 260; + visiblefire = 16; + }; + class Bolt; class WoodenArrow : Bolt { model = "\dayz_weapons\models\bolt"; @@ -7,19 +76,78 @@ class CfgAmmo { }; class Melee; class Machete_Swing_Ammo : Melee { - hit = 9; + hit = 53; simulation = "shotBullet"; + minRange = 1; + minRangeProbab = 0.8; + midRange = 2; + midRangeProbab = 1.5; + maxRange = 3; + maxRangeProbab = 2.5; + explosive = 0; + simulationStep = 0.001; + timeToLive = 0.03; + soundHit[] = {"", db-90, 1}; + soundEngine[] = {"", db-80, 4}; + }; + class Hatchet_Swing_Ammo : Melee { + hit = 50; + simulation = "shotBullet"; + minRange = 1; + minRangeProbab = 0.8; + midRange = 2; + midRangeProbab = 1.5; + maxRange = 3; + maxRangeProbab = 2.5; + explosive = 0; + simulationStep = 0.001; + timeToLive = 0.03; + soundHit[] = {"", db-90, 1}; + soundEngine[] = {"", db-80, 4}; + }; + class Crowbar_Swing_Ammo : Melee { + hit = 48; + simulation = "shotBullet"; + minRange = 1; + minRangeProbab = 0.8; + midRange = 2; + midRangeProbab = 1.5; + maxRange = 3; + maxRangeProbab = 2.5; + explosive = 0; + simulationStep = 0.001; + timeToLive = 0.03; + soundHit[] = {"", db-90, 1}; + soundEngine[] = {"", db-80, 4}; }; class Fishing_Swing_Ammo : Melee { - hit = 7; + hit = 45; simulation = "shotBullet"; + minRange = 1; + minRangeProbab = 1; + midRange = 2; + midRangeProbab = 2; + maxRange = 3; + maxRangeProbab = 3; + explosive = 0; + simulationStep = 0.001; + timeToLive = 0.03; + soundHit[] = {"", db-90, 1}; + soundEngine[] = {"", db-80, 4}; }; class Sledge_Swing_Ammo : Melee { - hit = 11; - simulation = "shotBullet"; - }; - class Dummy_Swing_Ammo : Melee { - hit = 0; + hit = 49; simulation = "shotBullet"; + minRange = 1; + minRangeProbab = 0.8; + midRange = 2; + midRangeProbab = 1.5; + maxRange = 3; + maxRangeProbab = 2.5; + explosive = 0; + simulationStep = 0.001; + timeToLive = 0.03; + soundHit[] = {"", db-90, 1}; + soundEngine[] = {"", db-80, 4}; }; }; From 2427367a42bebb45b65da580d137eab13aae70f7 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Wed, 6 Nov 2013 20:30:21 -0600 Subject: [PATCH 2/7] melee swing config from 1.8 --- .../Configs/CfgMagazines/MeleeSwing.hpp | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 SQF/dayz_code/Configs/CfgMagazines/MeleeSwing.hpp diff --git a/SQF/dayz_code/Configs/CfgMagazines/MeleeSwing.hpp b/SQF/dayz_code/Configs/CfgMagazines/MeleeSwing.hpp new file mode 100644 index 000000000..a5ce289f5 --- /dev/null +++ b/SQF/dayz_code/Configs/CfgMagazines/MeleeSwing.hpp @@ -0,0 +1,100 @@ +class Melee_Swing : CA_Magazine { + // scopeWeapon = protected; + // scopeMagazine = protected; + // magazineType = WeaponNoSlot; + type = VSoft; + flash = ""; + flashSize = 0; + initSpeed = 100; + maxLeadSpeed = 15; //20 + dexterity = 2; //20 + picture = "\dayz_weapons\textures\equip_shells_ca.paa"; + displayName = "crt"; + displayNameMagazine = "crt"; + shortNameMagazine = "crt"; + optics = false; + distanceZoomMin = 0; + distanceZoomMax = 0; + reloadTime = 0.1; + magazineReloadTime = 0.01; + drySound[] = {"", 0, 1}; + reloadMagazineSound[] = {"", 0, 1}; + modes[] = {"Single"}; + sound[] = {"Weapons\grenade_launch", 0.0031623, 1}; + reloadSound[] = {"", 0.0003162, 1}; + showEmpty = 0; + autoReload = true; + count = 100000; + canLock = LockNo; + // + burst = 1; + multiplier = 1; + ffMagnitude = 0.1; + ffFrequency = 1; + ffCount = 1; + recoil = "Empty"; + dispersion = 0.2; + class HitEffects { + hit_blood = "ImpactBlood"; + hit_concrete = "ImpactConcrete"; + hit_foliage = "ImpactLeaves"; + hit_foliage_green = "ImpactLeavesGreen"; + hit_glass = "ImpactGlass"; + hit_glass_thin = "ImpactGlassThin"; + hit_metal = "ImpactMetal"; + hit_plaster = "ImpactPlaster"; + hit_rubber = "ImpactRubber"; + hit_wood = "ImpactWood"; + }; +}; + +class Machete_Swing : Melee_Swing { + displayName = Machete; + displayNameMagazine = Machete; + shortNameMagazine = Machete; + ammo = "Machete_Swing_Ammo"; +}; +class crowbar_swing : Melee_Swing { + displayName = Crowbar; + displayNameMagazine = Crowbar; + shortNameMagazine = Crowbar; + ammo = "Crowbar_Swing_Ammo"; +}; +class Fishing_Swing : Melee_Swing { + displayName = Fishing; + displayNameMagazine = Fishing; + shortNameMagazine = Fishing; + ammo = "Fishing_Swing_Ammo"; +}; +class sledge_swing : Melee_Swing { + displayName = "Sledge"; + displayNameMagazine = "Sledge"; + shortNameMagazine = "Sledge"; + ammo = "Sledge_Swing_Ammo"; +}; +class Hatchet_Swing : Melee_Swing { + displayName = Hatchet; + displayNameMagazine = Hatchet; + shortNameMagazine = Hatchet; + ammo = "Hatchet_Swing_Ammo"; +}; +/* +class Bat_Swing : Melee_Swing { + displayName = BaseBallBat; + displayNameMagazine = BaseBallBat; + shortNameMagazine = BaseBallBat; + ammo = Bat_Swing_Ammo; +}; +class BatBarbed_Swing : Melee_Swing { + displayName = BaseBallBatBarbed; + displayNameMagazine = BaseBallBatBarbed; + shortNameMagazine = BaseBallBatBarbed; + ammo = BatBarbed_Swing_Ammo; +}; +class BatNails_Swing : Melee_Swing { + displayName = BaseBallBatNails; + displayNameMagazine = BaseBallBatNails; + shortNameMagazine = BaseBallBatNails; + ammo = BatNailed_Swing_Ammo; +}; +*/ \ No newline at end of file From 76cff49af503d4fffbc6cf938ac07c9f1f35d66b Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Wed, 6 Nov 2013 20:47:22 -0600 Subject: [PATCH 3/7] zeroweather and large hive read for vehicles --- SQF/dayz_server/compile/server_weather.sqf | 89 ++++++++++++++++++++++ SQF/dayz_server/init/server_functions.sqf | 15 +++- SQF/dayz_server/system/server_monitor.sqf | 2 +- 3 files changed, 103 insertions(+), 3 deletions(-) create mode 100644 SQF/dayz_server/compile/server_weather.sqf diff --git a/SQF/dayz_server/compile/server_weather.sqf b/SQF/dayz_server/compile/server_weather.sqf new file mode 100644 index 000000000..fafcdf773 --- /dev/null +++ b/SQF/dayz_server/compile/server_weather.sqf @@ -0,0 +1,89 @@ +private ["_weather","_windX","_windY","_weatherOptions","_numWeatherOptions","_forcastTime"]; + +//[overCast,Fog,wind,rain] +//wind is split randomly in to east-west/north-south direction +_weatherOptions = +[ + [0, 0, 5, 0], + [0, 0, 4, 0], + [0, 0, 3, 0], + [0, 0.1, 2, 0], + [0, 0.2, 1, 0], + [0, 0.3, 2, 0], + [0, 0.4, 3, 0], + [0, 0.5, 4, 0], + [0, 0.4, 5, 0], + [0, 0.3, 5, 0], + [0, 0.2, 4, 0], + [0.1, 0.1, 3, 0.1], + [0.2, 0.1, 2, 0.2], + [0.3, 0, 1, 0.3], + [0.4, 0, 2, 0.4], + [0.5, 0, 3, 0.5], + [0.6, 0, 4, 0.6], + [0.7, 0, 5, 0.7], + [0.8, 0, 6, 0.8], + [0.9, 0, 7, 0.9], + [1, 0, 8, 1], + [0.9, 0, 9, 0.9], + [0.8, 0, 8, 0.8], + [0.7, 0.1, 7, 0.7], + [0.6, 0.2, 6, 0.6], + [0.5, 0.3, 5, 0.5], + [0.4, 0.4, 4, 0.4], + [0.3, 0.5, 3, 0.3], + [0.2, 0.4, 3, 0.2], + [0.1, 0.3, 4, 0.1], + [0.2, 0.2, 5, 0.2], + [0.3, 0.1, 6, 0.3], + [0.4, 0.2, 7, 0.4], + [0.5, 0.3, 8, 0.5], + [0.5, 0.4, 9, 0.6], + [0.6, 0.5, 10, 0.7], + [0.5, 0.6, 11, 0.8], + [0.4, 0.7, 12, 0.8], + [0.3, 0.8, 13, 0.9], + [0.2, 0.9, 14, 0.9], + [0.1, 1, 15, 1] +]; +_numWeatherOptions = count _weatherOptions; + +// get inital weather forcast for the next 60 minutes +_forcastTime = 3600; +if (isNil "WeatherForcast" and isNil "WeatherForcastTime") then { + WeatherForcast = floor(random(_numWeatherOptions)); + WeatherForcastTime = diag_tickTime; +} else { + // after 60 minutes get a new forcast + if (WeatherForcastTime >= _forcastTime) then { + WeatherForcast = floor(random(_numWeatherOptions)); + WeatherForcastTime = diag_tickTime; + }; +}; + +if (isNil "CurrentWeatherOption") then { + // set inital weather to current forcast + CurrentWeatherOption = WeatherForcast; +} else { + if(CurrentWeatherOption < WeatherForcast) then { + // start transition up if forcast is higher in the array than current weather + CurrentWeatherOption = ((CurrentWeatherOption + 1) min _weatherOptions); + } else { + // start transition down if forcast is lower in the array than current weather + if (CurrentWeatherOption != WeatherForcast and WeatherForcastTime >= _forcastTime) then { + CurrentWeatherOption = ((CurrentWeatherOption - 1) max 0) ; + }; + }; +}; + +// current weather +_weather = _weatherOptions select CurrentWeatherOption; + +_windX = floor(random(_weather select 2)); +_windY = (_weather select 2) - _windX; +_weather set [2,[_windX,_windY]]; + +diag_log format["Weather %1", _weather]; + +PVDZE_plr_SetWeather = _weather; +publicVariable "PVDZE_plr_SetWeather"; \ No newline at end of file diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index a4523c335..da13c6a88 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -24,7 +24,8 @@ zombie_findOwner = compile preprocessFileLineNumbers "\z\addons\dayz_server\co server_updateNearbyObjects = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateNearbyObjects.sqf"; server_spawnCrashSite = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCrashSite.sqf"; server_handleZedSpawn = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_handleZedSpawn.sqf"; -server_spawnEvents = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnEvent.sqf"; +server_spawnEvents = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnEvent.sqf"; +server_weather = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_weather.sqf"; fnc_plyrHit = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.sqf"; server_deaths = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDeaths.sqf"; @@ -154,11 +155,21 @@ server_hiveReadWrite = { _key = _this; //diag_log ("ATTEMPT READ/WRITE: " + _key); _data = "HiveExt" callExtension _key; - //diag_log ("READ/WRITE: " +str(_data)); + // diag_log ("READ/WRITE: " +str(_data)); _resultArray = call compile format ["%1",_data]; _resultArray }; +server_hiveReadWriteLarge = { + private["_key","_resultArray","_data"]; + _key = _this; + //diag_log ("ATTEMPT READ/WRITE: " + _key); + _data = "HiveExt" callExtension _key; + // diag_log ("READ/WRITE: " +str(_data)); + _resultArray = call compile _data; + _resultArray +}; + server_characterSync = { private ["_characterID","_playerPos","_playerGear","_playerBackp","_medical","_currentState","_currentModel","_key"]; _characterID = _this select 0; diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf index 72bf69ffd..b5c68e755 100644 --- a/SQF/dayz_server/system/server_monitor.sqf +++ b/SQF/dayz_server/system/server_monitor.sqf @@ -87,7 +87,7 @@ if (isServer and isNil "sm_done") then { _objectCount = _hiveResponse select 1; diag_log ("HIVE: Commence Object Streaming..."); for "_i" from 1 to _objectCount do { - _hiveResponse = _key call server_hiveReadWrite; + _hiveResponse = _key call server_hiveReadWriteLarge; _objectArray set [_i - 1, _hiveResponse]; //diag_log (format["HIVE dbg %1 %2", typeName _hiveResponse, _hiveResponse]); }; From 527ed3283b51a76995049c2dca7e8acb9143ffa7 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Wed, 6 Nov 2013 20:50:22 -0600 Subject: [PATCH 4/7] better fn_string by KK --- SQF/dayz_code/compile/fn_inString.sqf | 55 ++++++++++++++------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/SQF/dayz_code/compile/fn_inString.sqf b/SQF/dayz_code/compile/fn_inString.sqf index e704e97ac..12203f544 100644 --- a/SQF/dayz_code/compile/fn_inString.sqf +++ b/SQF/dayz_code/compile/fn_inString.sqf @@ -1,28 +1,31 @@ -//Kilzone_Kid's megafast inString function -//caseinsensitive -//params [needle,haystack] -private["_needle","_haystack","_found","_haystackArr","_haystackLen","_needleLen","_hayArr"]; -scopeName "main"; -_needle = _this select 0; -_haystack = _this select 1; -_haystackArr = toArray _haystack; -_haystackLen = count _haystackArr; -_needleLen = count (toArray _needle); +/* +Author: Killzone_Kid + +Description: +Find a string within a string (case insensitive) + +Parameter(s): +_this select 0: string to be found +_this select 1: string to search in + +Returns: +Boolean (true when string is found) + +How to use: +_found = ["needle", "Needle in Haystack"] call KK_fnc_inString; +*/ + +private ["_needle","_haystack","_needleLen","_hay","_found"]; +_needle = [_this, 0, "", [""]] call BIS_fnc_param; +_haystack = toArray ([_this, 1, "", [""]] call BIS_fnc_param); +_needleLen = count toArray _needle; +_hay = +_haystack; +_hay resize _needleLen; _found = false; -if (_needleLen <= _haystackLen) then { - _hayArr = []; - for "_i" from 0 to (_needleLen - 1) do { - _hayArr set [count _hayArr, _haystackArr select _i]; - }; - for "_i" from _needleLen to _haystackLen do { - if (toString _hayArr != _needle) then { - _hayArr set [_needleLen, _haystackArr select _i]; - _hayArr set [0, "x"]; - _hayArr = _hayArr - ["x"]; - } else { - _found = true; - breakTo "main"; - }; - }; +for "_i" from _needleLen to count _haystack do { + if (toString _hay == _needle) exitWith {_found = true}; + _hay set [_needleLen, _haystack select _i]; + _hay set [0, "x"]; + _hay = _hay - ["x"] }; -_found +_found \ No newline at end of file From da0ece239fce2d6dcb7c2f862368b43e933f5c95 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Wed, 6 Nov 2013 20:56:12 -0600 Subject: [PATCH 5/7] removed old tree harvest action added new one --- .../Configs/CfgWeapons/Melee/MeleeHatchet.hpp | 5 -- SQF/dayz_code/actions/player_chopWood.sqf | 2 +- SQF/dayz_code/compile/fn_damageHandler.sqf | 7 ++- .../compile/fn_damageHandlerVehicle.sqf | 9 ++- SQF/dayz_code/compile/fn_damageHandlerZ.sqf | 5 ++ SQF/dayz_code/compile/player_fired.sqf | 3 + SQF/dayz_code/compile/player_harvest.sqf | 62 +++++++++++++++++++ SQF/dayz_code/medical/setup_functions_med.sqf | 4 ++ 8 files changed, 89 insertions(+), 8 deletions(-) create mode 100644 SQF/dayz_code/compile/player_harvest.sqf diff --git a/SQF/dayz_code/Configs/CfgWeapons/Melee/MeleeHatchet.hpp b/SQF/dayz_code/Configs/CfgWeapons/Melee/MeleeHatchet.hpp index 37b157c6e..ab7587206 100644 --- a/SQF/dayz_code/Configs/CfgWeapons/Melee/MeleeHatchet.hpp +++ b/SQF/dayz_code/Configs/CfgWeapons/Melee/MeleeHatchet.hpp @@ -19,11 +19,6 @@ class MeleeHatchet: MeleeWeapon }; class ItemActions { - class Use - { - text="$STR_ACTIONS_CHOPWOOD"; - script="spawn player_chopWood;"; - }; class Toolbelt { text="Add to Toolbelt"; diff --git a/SQF/dayz_code/actions/player_chopWood.sqf b/SQF/dayz_code/actions/player_chopWood.sqf index 1c065105e..df402c300 100644 --- a/SQF/dayz_code/actions/player_chopWood.sqf +++ b/SQF/dayz_code/actions/player_chopWood.sqf @@ -11,7 +11,7 @@ TradeInprogress = true; if((currentWeapon player) != "MeleeHatchet") exitWith {TradeInprogress = false; cutText [(localize "str_epoch_player_54"), "PLAIN DOWN"]; }; // allowed trees list move this later -_trees = ["t_larix3s.p3d","t_pyrus2s.p3d","str_briza_kriva.p3d","dd_borovice.p3d","les_singlestrom_b.p3d","les_singlestrom.p3d","smrk_velky.p3d","smrk_siroky.p3d","smrk_maly.p3d","les_buk.p3d","str krovisko vysoke.p3d","str_fikovnik_ker.p3d","str_fikovnik.p3d","str vrba.p3d","hrusen2.p3d","str dub jiny.p3d","str lipa.p3d","str briza.p3d","p_akat02s.p3d","jablon.p3d","p_buk.p3d","str_topol.p3d","str_topol2.p3d","p_osika.p3d","t_picea3f.p3d","t_picea2s.p3d","t_picea1s.p3d","t_fagus2w.p3d","t_fagus2s.p3d","t_fagus2f.p3d","t_betula1f.p3d","t_betula2f.p3d","t_betula2s.p3d","t_betula2w.p3d","t_alnus2s.p3d","t_acer2s.p3d","t_populus3s.p3d","t_quercus2f.p3d","t_sorbus2s.p3d","t_malus1s.p3d","t_salix2s.p3d","t_picea1s_w.p3d","t_picea2s_w.p3d","t_ficusb2s_ep1.p3d","t_populusb2s_ep1.p3d","t_populusf2s_ep1.p3d","t_amygdalusc2s_ep1.p3d","t_ficusb2s_ep1.p3d","t_pistacial2s_ep1.p3d","t_pinuse2s_ep1.p3d","t_pinuss3s_ep1.p3d","t_prunuss2s_ep1.p3d","t_pinusn2s.p3d","t_pinusn1s.p3d","t_pinuss2f.p3d","t_poplar2f_dead_pmc.p3d","misc_torzotree_pmc.p3d","misc_burnspruce_pmc.p3d","brg_cocunutpalm8.p3d","brg_umbrella_acacia01b.p3d","brg_jungle_tree_canopy_1.p3d","brg_jungle_tree_canopy_2.p3d","brg_cocunutpalm4.p3d","brg_cocunutpalm3.p3d","palm_01.p3d","palm_02.p3d","palm_03.p3d","palm_04.p3d","palm_09.p3d","palm_10.p3d","brg_cocunutpalm2.p3d","brg_jungle_tree_antiaris.p3d","brg_cocunutpalm1.p3d"]; +_trees = DZE_trees; //_item = _this; call gear_ui_init; diff --git a/SQF/dayz_code/compile/fn_damageHandler.sqf b/SQF/dayz_code/compile/fn_damageHandler.sqf index f7d6c9aca..96c1a7a0c 100644 --- a/SQF/dayz_code/compile/fn_damageHandler.sqf +++ b/SQF/dayz_code/compile/fn_damageHandler.sqf @@ -14,6 +14,11 @@ _isPZombie = player isKindOf "PZombie_VB"; _source = _this select 3; _ammo = _this select 4; _type = [_damage,_ammo] call fnc_usec_damageType; + +if (_type == 3) then { + _damage = _damage * 0.024; +}; + _isMinor = (_hit in USEC_MinorWounds); _isHeadHit = (_hit == "head_hit"); //_evType = ""; @@ -89,7 +94,7 @@ if (_damage > 0.4) then { if (_unitIsPlayer) then { //Cause blood loss //Log Damage - //diag_log ("DAMAGE: player hit by " + typeOf _source + " in " + _hit + " with " + _ammo + " for " + str(_damage) + " scaled " + str(_damage * _scale)); + diag_log ("DAMAGE: player hit by " + typeOf _source + " in " + _hit + " with " + _ammo + " for " + str(_damage) + " scaled " + str(_damage * _scale)); r_player_blood = r_player_blood - (_damage * _scale); }; }; diff --git a/SQF/dayz_code/compile/fn_damageHandlerVehicle.sqf b/SQF/dayz_code/compile/fn_damageHandlerVehicle.sqf index b33044509..8bc0a5958 100644 --- a/SQF/dayz_code/compile/fn_damageHandlerVehicle.sqf +++ b/SQF/dayz_code/compile/fn_damageHandlerVehicle.sqf @@ -9,7 +9,14 @@ _unit = _this select 0; _hit = _this select 1; _damage = _this select 2; //_source = _this select 3; -//_ammo = _this select 4; +_ammo = _this select 4; + +_type = [_damage,_ammo] call fnc_usec_damageType; + +if (_type == 3) then { + _damage = _damage * 0.024; +}; + _total = _damage; //diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit)); diff --git a/SQF/dayz_code/compile/fn_damageHandlerZ.sqf b/SQF/dayz_code/compile/fn_damageHandlerZ.sqf index a9121e5a6..8ddad3859 100644 --- a/SQF/dayz_code/compile/fn_damageHandlerZ.sqf +++ b/SQF/dayz_code/compile/fn_damageHandlerZ.sqf @@ -10,6 +10,11 @@ _hitter = _this select 3; _projectile = _this select 4; if (local _zed) then { + + if (_projectile isKindOf "Melee") then { + _damage = _damage * 0.024; + }; + if (_damage > 1 and _projectile != "") then { //Record deliberate critical damages switch (_selection) do { diff --git a/SQF/dayz_code/compile/player_fired.sqf b/SQF/dayz_code/compile/player_fired.sqf index 9a5bf6b56..11e23f8e0 100644 --- a/SQF/dayz_code/compile/player_fired.sqf +++ b/SQF/dayz_code/compile/player_fired.sqf @@ -17,6 +17,9 @@ dayz_combat = 1; if (_ammo isKindOf "Melee") exitWith { _unit playActionNow "GestureSwing"; + + // harvest wood check + _id = _this spawn player_harvest; }; //Smoke Grenade diff --git a/SQF/dayz_code/compile/player_harvest.sqf b/SQF/dayz_code/compile/player_harvest.sqf new file mode 100644 index 000000000..5448d6570 --- /dev/null +++ b/SQF/dayz_code/compile/player_harvest.sqf @@ -0,0 +1,62 @@ +private ["_unit","_ammo","_distance","_weapon","_projectile","_endPos","_dir","_doWait","_vel"]; +_unit = _this select 0; +_weapon = _this select 1; +_ammo = _this select 4; +_projectile = _this select 6; + +if (_ammo isKindOf "Hatchet_Swing_Ammo") then { + + _findNearestTree = []; + { + if("" == typeOf _x) then { + + if (alive _x) then { + + _objName = _x call DZE_getModelName; + + // Exit since we found a tree + if (_objName in DZE_trees) exitWith { + _findNearestTree set [(count _findNearestTree),_x]; + }; + }; + }; + } foreach nearestObjects [getPosATL player, [], 20]; + + //diag_log ("POSITION: " + str(_endPos)); + + if (count(_findNearestTree) >= 1) then { + + _tree = _findNearestTree select 0; + + // get 2d distance + _distance2d = [player, _tree] call BIS_fnc_distance2D; + + if(_distance2d <= 5) then { + + // damage must be going down + _damage = damage _tree; + if (DZE_TEMP_treedmg < _damage) then { + + //diag_log ("DAMAGE: " + str(damage _tree)); + + _countOut = 1; + _itemOut = "PartWoodPile"; + + _nearByPile= nearestObjects [getPosATL player, ["WeaponHolder"],2]; + if (count _nearByPile == 0) then { + _item = createVehicle ["WeaponHolder", getPosATL player, [], 1, "CAN_COLLIDE"]; + _item addMagazineCargoGlobal [_itemOut,_countOut]; + player reveal _item; + } else { + _item = _nearByPile select 0; + _item addMagazineCargoGlobal [_itemOut,_countOut]; + }; + + _distance = 60; + [_unit,_distance,false,getPosATL player] spawn player_alertZombies; + + }; + DZE_TEMP_treedmg = _damage; + }; + }; +}; \ No newline at end of file diff --git a/SQF/dayz_code/medical/setup_functions_med.sqf b/SQF/dayz_code/medical/setup_functions_med.sqf index 12e8a52a1..43e385870 100644 --- a/SQF/dayz_code/medical/setup_functions_med.sqf +++ b/SQF/dayz_code/medical/setup_functions_med.sqf @@ -90,6 +90,10 @@ fnc_usec_damageType = { if ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")) then { _type = 2; }; + if (_ammo isKindof "Melee") then { + _type = 3; + }; + _type; }; From b7e0e8e96943c91b0168cd5bf461d19e91876962 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Wed, 6 Nov 2013 20:56:51 -0600 Subject: [PATCH 6/7] weather pt 2 --- SQF/dayz_code/init/publicEH.sqf | 1 + SQF/dayz_code/system/player_spawn_1.sqf | 6 ++++++ SQF/dayz_server/compile/server_spawnEvent.sqf | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/SQF/dayz_code/init/publicEH.sqf b/SQF/dayz_code/init/publicEH.sqf index e46ac4a26..3044b87d1 100644 --- a/SQF/dayz_code/init/publicEH.sqf +++ b/SQF/dayz_code/init/publicEH.sqf @@ -59,6 +59,7 @@ if (isServer) then { //Client only if (!isDedicated) then { "PVDZE_plr_SetDate" addPublicVariableEventHandler {(_this select 1) call player_setDate}; + "PVDZE_plr_SetWeather" addPublicVariableEventHandler {zeroCurrentWeather = (_this select 1)}; "PVDZE_obj_RoadFlare" addPublicVariableEventHandler {(_this select 1) spawn object_roadFlare}; "PVDZE_plr_Morph2" addPublicVariableEventHandler {(_this select 1) call player_serverModelChange}; "PVDZE_plr_Morph" addPublicVariableEventHandler {(_this select 1) call server_switchPlayer}; diff --git a/SQF/dayz_code/system/player_spawn_1.sqf b/SQF/dayz_code/system/player_spawn_1.sqf index 8604a6b2b..9721d36ce 100644 --- a/SQF/dayz_code/system/player_spawn_1.sqf +++ b/SQF/dayz_code/system/player_spawn_1.sqf @@ -42,6 +42,12 @@ while {true} do { dayz_PreviousTown = _town; }; + // Set weather + 0 setOvercast (zeroCurrentWeather select 0); + 0 setFog (zeroCurrentWeather select 1); + setWind [((zeroCurrentWeather select 2) select 0),((zeroCurrentWeather select 2) select 1),true]; + 0 setRain (zeroCurrentWeather select 3); + //wait sleep 5; }; \ No newline at end of file diff --git a/SQF/dayz_server/compile/server_spawnEvent.sqf b/SQF/dayz_server/compile/server_spawnEvent.sqf index 9dd0ebcca..78a9aabb1 100644 --- a/SQF/dayz_server/compile/server_spawnEvent.sqf +++ b/SQF/dayz_server/compile/server_spawnEvent.sqf @@ -31,6 +31,7 @@ epoch_eventIsAny = { _boolReturn }; +zero_weather = diag_tickTime; zero_cleanDead = diag_tickTime; zero_cleanLoot = diag_tickTime; @@ -60,6 +61,10 @@ while {true} do { } forEach EpochEvents; _time = diag_tickTime; + if ((_time - zero_weather) > 300) then { + call server_weather; + zero_weather = _time; + }; // perform cleanup here if ((_time - zero_cleanDead) > 600) then { call server_cleanDead; From 7e11c8a409c5d51f2ca22de77f458bca7666f447 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Wed, 6 Nov 2013 20:58:35 -0600 Subject: [PATCH 7/7] pt 3 --- SQF/dayz_code/init/variables.sqf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 83c32566f..bdf50b706 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -551,6 +551,8 @@ if(!isDedicated) then { dayz_buildingMonitor = []; //Buildings to check dayz_bodyMonitor = []; + // weather control var + zeroCurrentWeather = [0,0,[0,0],0]; dayz_baseTypes = getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");