mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
@@ -4635,32 +4635,9 @@ class CfgMagazines {
|
|||||||
displayName = $STR_ITEMWATERBOTTLEBOILED_CODE_NAME;
|
displayName = $STR_ITEMWATERBOTTLEBOILED_CODE_NAME;
|
||||||
descriptionShort = $STR_ITEMWATERBOTTLEBOILED_CODE_DESC;
|
descriptionShort = $STR_ITEMWATERBOTTLEBOILED_CODE_DESC;
|
||||||
};
|
};
|
||||||
class Hatchet_Swing;
|
|
||||||
class Machete_Swing : Hatchet_Swing {
|
#include "CfgMagazines\MeleeSwing.hpp"
|
||||||
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";
|
|
||||||
};
|
|
||||||
// class HandGrenade;
|
// class HandGrenade;
|
||||||
class ItemTrashToiletpaper : HandGrenade {
|
class ItemTrashToiletpaper : HandGrenade {
|
||||||
scope = public;
|
scope = public;
|
||||||
|
|||||||
100
SQF/dayz_code/Configs/CfgMagazines/MeleeSwing.hpp
Normal file
100
SQF/dayz_code/Configs/CfgMagazines/MeleeSwing.hpp
Normal file
@@ -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;
|
||||||
|
};
|
||||||
|
*/
|
||||||
@@ -19,11 +19,6 @@ class MeleeHatchet: MeleeWeapon
|
|||||||
};
|
};
|
||||||
class ItemActions
|
class ItemActions
|
||||||
{
|
{
|
||||||
class Use
|
|
||||||
{
|
|
||||||
text="$STR_ACTIONS_CHOPWOOD";
|
|
||||||
script="spawn player_chopWood;";
|
|
||||||
};
|
|
||||||
class Toolbelt
|
class Toolbelt
|
||||||
{
|
{
|
||||||
text="Add to Toolbelt";
|
text="Add to Toolbelt";
|
||||||
|
|||||||
@@ -1,4 +1,73 @@
|
|||||||
class CfgAmmo {
|
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 Bolt;
|
||||||
class WoodenArrow : Bolt {
|
class WoodenArrow : Bolt {
|
||||||
model = "\dayz_weapons\models\bolt";
|
model = "\dayz_weapons\models\bolt";
|
||||||
@@ -7,19 +76,78 @@ class CfgAmmo {
|
|||||||
};
|
};
|
||||||
class Melee;
|
class Melee;
|
||||||
class Machete_Swing_Ammo : Melee {
|
class Machete_Swing_Ammo : Melee {
|
||||||
hit = 9;
|
hit = 53;
|
||||||
simulation = "shotBullet";
|
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 {
|
class Fishing_Swing_Ammo : Melee {
|
||||||
hit = 7;
|
hit = 45;
|
||||||
simulation = "shotBullet";
|
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 {
|
class Sledge_Swing_Ammo : Melee {
|
||||||
hit = 11;
|
hit = 49;
|
||||||
simulation = "shotBullet";
|
|
||||||
};
|
|
||||||
class Dummy_Swing_Ammo : Melee {
|
|
||||||
hit = 0;
|
|
||||||
simulation = "shotBullet";
|
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};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ TradeInprogress = true;
|
|||||||
if((currentWeapon player) != "MeleeHatchet") exitWith {TradeInprogress = false; cutText [(localize "str_epoch_player_54"), "PLAIN DOWN"]; };
|
if((currentWeapon player) != "MeleeHatchet") exitWith {TradeInprogress = false; cutText [(localize "str_epoch_player_54"), "PLAIN DOWN"]; };
|
||||||
|
|
||||||
// allowed trees list move this later
|
// 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;
|
//_item = _this;
|
||||||
call gear_ui_init;
|
call gear_ui_init;
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ _isPZombie = player isKindOf "PZombie_VB";
|
|||||||
_source = _this select 3;
|
_source = _this select 3;
|
||||||
_ammo = _this select 4;
|
_ammo = _this select 4;
|
||||||
_type = [_damage,_ammo] call fnc_usec_damageType;
|
_type = [_damage,_ammo] call fnc_usec_damageType;
|
||||||
|
|
||||||
|
if (_type == 3) then {
|
||||||
|
_damage = _damage * 0.024;
|
||||||
|
};
|
||||||
|
|
||||||
_isMinor = (_hit in USEC_MinorWounds);
|
_isMinor = (_hit in USEC_MinorWounds);
|
||||||
_isHeadHit = (_hit == "head_hit");
|
_isHeadHit = (_hit == "head_hit");
|
||||||
//_evType = "";
|
//_evType = "";
|
||||||
@@ -89,7 +94,7 @@ if (_damage > 0.4) then {
|
|||||||
if (_unitIsPlayer) then {
|
if (_unitIsPlayer) then {
|
||||||
//Cause blood loss
|
//Cause blood loss
|
||||||
//Log Damage
|
//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);
|
r_player_blood = r_player_blood - (_damage * _scale);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,7 +9,14 @@ _unit = _this select 0;
|
|||||||
_hit = _this select 1;
|
_hit = _this select 1;
|
||||||
_damage = _this select 2;
|
_damage = _this select 2;
|
||||||
//_source = _this select 3;
|
//_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;
|
_total = _damage;
|
||||||
|
|
||||||
//diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit));
|
//diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit));
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ _hitter = _this select 3;
|
|||||||
_projectile = _this select 4;
|
_projectile = _this select 4;
|
||||||
|
|
||||||
if (local _zed) then {
|
if (local _zed) then {
|
||||||
|
|
||||||
|
if (_projectile isKindOf "Melee") then {
|
||||||
|
_damage = _damage * 0.024;
|
||||||
|
};
|
||||||
|
|
||||||
if (_damage > 1 and _projectile != "") then {
|
if (_damage > 1 and _projectile != "") then {
|
||||||
//Record deliberate critical damages
|
//Record deliberate critical damages
|
||||||
switch (_selection) do {
|
switch (_selection) do {
|
||||||
|
|||||||
@@ -1,28 +1,31 @@
|
|||||||
//Kilzone_Kid's megafast inString function
|
/*
|
||||||
//caseinsensitive
|
Author: Killzone_Kid
|
||||||
//params [needle,haystack]
|
|
||||||
private["_needle","_haystack","_found","_haystackArr","_haystackLen","_needleLen","_hayArr"];
|
Description:
|
||||||
scopeName "main";
|
Find a string within a string (case insensitive)
|
||||||
_needle = _this select 0;
|
|
||||||
_haystack = _this select 1;
|
Parameter(s):
|
||||||
_haystackArr = toArray _haystack;
|
_this select 0: <string> string to be found
|
||||||
_haystackLen = count _haystackArr;
|
_this select 1: <string> string to search in
|
||||||
_needleLen = count (toArray _needle);
|
|
||||||
|
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;
|
_found = false;
|
||||||
if (_needleLen <= _haystackLen) then {
|
for "_i" from _needleLen to count _haystack do {
|
||||||
_hayArr = [];
|
if (toString _hay == _needle) exitWith {_found = true};
|
||||||
for "_i" from 0 to (_needleLen - 1) do {
|
_hay set [_needleLen, _haystack select _i];
|
||||||
_hayArr set [count _hayArr, _haystackArr select _i];
|
_hay set [0, "x"];
|
||||||
};
|
_hay = _hay - ["x"]
|
||||||
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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
_found
|
_found
|
||||||
@@ -17,6 +17,9 @@ dayz_combat = 1;
|
|||||||
|
|
||||||
if (_ammo isKindOf "Melee") exitWith {
|
if (_ammo isKindOf "Melee") exitWith {
|
||||||
_unit playActionNow "GestureSwing";
|
_unit playActionNow "GestureSwing";
|
||||||
|
|
||||||
|
// harvest wood check
|
||||||
|
_id = _this spawn player_harvest;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Smoke Grenade
|
//Smoke Grenade
|
||||||
|
|||||||
62
SQF/dayz_code/compile/player_harvest.sqf
Normal file
62
SQF/dayz_code/compile/player_harvest.sqf
Normal file
@@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -59,6 +59,7 @@ if (isServer) then {
|
|||||||
//Client only
|
//Client only
|
||||||
if (!isDedicated) then {
|
if (!isDedicated) then {
|
||||||
"PVDZE_plr_SetDate" addPublicVariableEventHandler {(_this select 1) call player_setDate};
|
"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_obj_RoadFlare" addPublicVariableEventHandler {(_this select 1) spawn object_roadFlare};
|
||||||
"PVDZE_plr_Morph2" addPublicVariableEventHandler {(_this select 1) call player_serverModelChange};
|
"PVDZE_plr_Morph2" addPublicVariableEventHandler {(_this select 1) call player_serverModelChange};
|
||||||
"PVDZE_plr_Morph" addPublicVariableEventHandler {(_this select 1) call server_switchPlayer};
|
"PVDZE_plr_Morph" addPublicVariableEventHandler {(_this select 1) call server_switchPlayer};
|
||||||
|
|||||||
@@ -551,6 +551,8 @@ if(!isDedicated) then {
|
|||||||
dayz_buildingMonitor = []; //Buildings to check
|
dayz_buildingMonitor = []; //Buildings to check
|
||||||
dayz_bodyMonitor = [];
|
dayz_bodyMonitor = [];
|
||||||
|
|
||||||
|
// weather control var
|
||||||
|
zeroCurrentWeather = [0,0,[0,0],0];
|
||||||
|
|
||||||
dayz_baseTypes = getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
dayz_baseTypes = getArray (configFile >> "CfgBuildingLoot" >> "Default" >> "zombieClass");
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,10 @@ fnc_usec_damageType = {
|
|||||||
if ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")) then {
|
if ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")) then {
|
||||||
_type = 2;
|
_type = 2;
|
||||||
};
|
};
|
||||||
|
if (_ammo isKindof "Melee") then {
|
||||||
|
_type = 3;
|
||||||
|
};
|
||||||
|
|
||||||
_type;
|
_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ while {true} do {
|
|||||||
dayz_PreviousTown = _town;
|
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
|
//wait
|
||||||
sleep 5;
|
sleep 5;
|
||||||
};
|
};
|
||||||
@@ -31,6 +31,7 @@ epoch_eventIsAny = {
|
|||||||
_boolReturn
|
_boolReturn
|
||||||
};
|
};
|
||||||
|
|
||||||
|
zero_weather = diag_tickTime;
|
||||||
zero_cleanDead = diag_tickTime;
|
zero_cleanDead = diag_tickTime;
|
||||||
zero_cleanLoot = diag_tickTime;
|
zero_cleanLoot = diag_tickTime;
|
||||||
|
|
||||||
@@ -60,6 +61,10 @@ while {true} do {
|
|||||||
} forEach EpochEvents;
|
} forEach EpochEvents;
|
||||||
|
|
||||||
_time = diag_tickTime;
|
_time = diag_tickTime;
|
||||||
|
if ((_time - zero_weather) > 300) then {
|
||||||
|
call server_weather;
|
||||||
|
zero_weather = _time;
|
||||||
|
};
|
||||||
// perform cleanup here
|
// perform cleanup here
|
||||||
if ((_time - zero_cleanDead) > 600) then {
|
if ((_time - zero_cleanDead) > 600) then {
|
||||||
call server_cleanDead;
|
call server_cleanDead;
|
||||||
|
|||||||
89
SQF/dayz_server/compile/server_weather.sqf
Normal file
89
SQF/dayz_server/compile/server_weather.sqf
Normal file
@@ -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";
|
||||||
@@ -25,6 +25,7 @@ server_updateNearbyObjects = compile preprocessFileLineNumbers "\z\addons\dayz_s
|
|||||||
server_spawnCrashSite = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCrashSite.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_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";
|
fnc_plyrHit = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.sqf";
|
||||||
server_deaths = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDeaths.sqf";
|
server_deaths = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDeaths.sqf";
|
||||||
@@ -154,11 +155,21 @@ server_hiveReadWrite = {
|
|||||||
_key = _this;
|
_key = _this;
|
||||||
//diag_log ("ATTEMPT READ/WRITE: " + _key);
|
//diag_log ("ATTEMPT READ/WRITE: " + _key);
|
||||||
_data = "HiveExt" callExtension _key;
|
_data = "HiveExt" callExtension _key;
|
||||||
//diag_log ("READ/WRITE: " +str(_data));
|
// diag_log ("READ/WRITE: " +str(_data));
|
||||||
_resultArray = call compile format ["%1",_data];
|
_resultArray = call compile format ["%1",_data];
|
||||||
_resultArray
|
_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 = {
|
server_characterSync = {
|
||||||
private ["_characterID","_playerPos","_playerGear","_playerBackp","_medical","_currentState","_currentModel","_key"];
|
private ["_characterID","_playerPos","_playerGear","_playerBackp","_medical","_currentState","_currentModel","_key"];
|
||||||
_characterID = _this select 0;
|
_characterID = _this select 0;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ if (isServer and isNil "sm_done") then {
|
|||||||
_objectCount = _hiveResponse select 1;
|
_objectCount = _hiveResponse select 1;
|
||||||
diag_log ("HIVE: Commence Object Streaming...");
|
diag_log ("HIVE: Commence Object Streaming...");
|
||||||
for "_i" from 1 to _objectCount do {
|
for "_i" from 1 to _objectCount do {
|
||||||
_hiveResponse = _key call server_hiveReadWrite;
|
_hiveResponse = _key call server_hiveReadWriteLarge;
|
||||||
_objectArray set [_i - 1, _hiveResponse];
|
_objectArray set [_i - 1, _hiveResponse];
|
||||||
//diag_log (format["HIVE dbg %1 %2", typeName _hiveResponse, _hiveResponse]);
|
//diag_log (format["HIVE dbg %1 %2", typeName _hiveResponse, _hiveResponse]);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user