Use Epoch player_harvest instead of player_chopWood

This commit is contained in:
ebaydayz
2016-04-19 16:51:20 -04:00
parent ba480fb218
commit f0c46a0764
11 changed files with 30 additions and 56 deletions

View File

@@ -13,11 +13,11 @@ class MeleeHatchet : MeleeWeapon
class ItemActions class ItemActions
{ {
class Use /*class Use // Must hit tree to chop wood on Epoch, see player_harvest
{ {
text = $STR_ACTIONS_CHOPWOOD; text = $STR_ACTIONS_CHOPWOOD;
script = "spawn player_chopWood"; script = "spawn player_chopWood";
}; };*/
class Toolbelt class Toolbelt
{ {

View File

@@ -9,11 +9,11 @@ class ItemHatchet : ItemCore
class ItemActions class ItemActions
{ {
class Use /*class Use // Must hit tree to chop wood on Epoch, see player_harvest
{ {
text = $STR_ACTIONS_CHOPWOOD; text = $STR_ACTIONS_CHOPWOOD;
script = "spawn player_chopWood;"; script = "spawn player_chopWood;";
}; };*/
class ToBack class ToBack
{ {

View File

@@ -1,5 +1,5 @@
private ["_item","_result","_dis","_sfx","_num","_breaking","_countOut","_woodCutting","_trees","_findNearestTree","_objInfo","_lenInfo","_objName","_i","_k","_counter","_isOk","_proceed","_animState","_started","_finished","_isMedic","_itemOut"]; private ["_item","_result","_dis","_sfx","_num","_breaking","_countOut","_woodCutting","_findNearestTree","_objName","_counter","_isOk","_proceed","_animState","_started","_finished","_isMedic","_itemOut"];
//if (!isnil "faco_player_chopWood") exitWith { _this call faco_player_chopWood }; //if (!isnil "faco_player_chopWood") exitWith { _this call faco_player_chopWood };
@@ -15,29 +15,11 @@ if (["forest",dayz_surfaceType] call fnc_inString) then {
_woodCutting = true; _woodCutting = true;
} else { } else {
// allowed trees list move this later
_trees = ["ind_timbers.p3d","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"];
_findNearestTree = objNull; _findNearestTree = objNull;
{ {
_objInfo = toArray(str(_x)); _objName = _x call fn_getModelName;
_lenInfo = count _objInfo - 1;
_objName = [];
_i = 0;
// determine where the object name starts
{
if (58 == _objInfo select _i) exitWith {};
_i = _i + 1;
} forEach _objInfo;
_i = _i + 2; // skip the ": " part
for "_k" from _i to _lenInfo do {
_objName = _objName + [_objInfo select _k];
};
_objName = toLower(toString(_objName));
// Exit since we found a tree // Exit since we found a tree
if (_objName in _trees) exitWith { _findNearestTree = _x; }; if (_objName in dayz_trees) exitWith { _findNearestTree = _x; };
} foreach nearestObjects [getPosATL player, [], 8]; } foreach nearestObjects [getPosATL player, [], 8];
_countOut = floor(random 3) + 2; _countOut = floor(random 3) + 2;

View File

@@ -13,7 +13,7 @@ _findNearestlight = [];
if (alive _x) then { if (alive _x) then {
_objName = _x call DZE_getModelName; _objName = _x call fn_getModelName;
if (_objName in _lights) then { if (_objName in _lights) then {
_findNearestlight set [(count _findNearestlight),_x]; _findNearestlight set [(count _findNearestlight),_x];

View File

@@ -23,7 +23,7 @@ _findNearestTree = [];
if (alive _x) then { if (alive _x) then {
_objName = _x call DZE_getModelName; _objName = _x call fn_getModelName;
// Exit since we found a tree // Exit since we found a tree
if (_objName in _trees) exitWith { if (_objName in _trees) exitWith {

View File

@@ -1,3 +1,5 @@
private ["_i","_k","_lenInfo","_objInfo","_objName"];
_objInfo = toArray(str(_this)); _objInfo = toArray(str(_this));
_lenInfo = count _objInfo - 1; _lenInfo = count _objInfo - 1;
_objName = []; _objName = [];

View File

@@ -14,7 +14,7 @@ _lights = ["a_fuelstation_sign.p3d","lampa_ind_zebr.p3d","lampa_ind.p3d","lampa_
if (alive _x) then { if (alive _x) then {
_objName = _x call DZE_getModelName; _objName = _x call fn_getModelName;
if (_objName in _lights) then { if (_objName in _lights) then {

View File

@@ -12,10 +12,10 @@ if (_ammo isKindOf "Hatchet_Swing_Ammo" || _ammo isKindOf "Chainsaw_Swing_Ammo")
if (alive _x) then { if (alive _x) then {
_objName = _x call DZE_getModelName; _objName = _x call fn_getModelName;
// Exit since we found a tree // Exit since we found a tree
if (_objName in DZE_trees) exitWith { if (_objName in dayz_trees) exitWith {
_findNearestTree set [(count _findNearestTree),_x]; _findNearestTree set [(count _findNearestTree),_x];
}; };
}; };
@@ -39,34 +39,20 @@ if (_ammo isKindOf "Hatchet_Swing_Ammo" || _ammo isKindOf "Chainsaw_Swing_Ammo")
if (_damage < 0.99) then { if (_damage < 0.99) then {
if("" == typeOf _tree) then { if("" == typeOf _tree) then {
_tree setDamage 0.99; PVDZ_objgather_Knockdown = [_tree,player]; // Ask server to setDamage on tree
publicVariableServer "PVDZ_objgather_Knockdown";
}; };
}; };
//diag_log ("DAMAGE: " + str(damage _tree)); //diag_log ("DAMAGE: " + str(damage _tree));
if (round(random 1) > 0.5) then { _itemOut = if (_ammo isKindOf "Chainsaw_Swing_Ammo") then {"PartWoodLumber"} else {"ItemLog"}; // Log can be crafted to > 2x plank > 4x woodpile
_itemOut call fn_dropItem;
_countOut = 1; _distance = 60;
_itemOut = "PartWoodPile"; [player,_distance,false,getPosATL player] spawn player_alertZombies;
// Working-Factor for chopping wood.
if(_ammo isKindOf "Chainsaw_Swing_Ammo") then { ["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
_itemOut = "PartWoodLumber";
};
_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;
[player,_distance,false,getPosATL player] spawn player_alertZombies;
};
}; };
DZE_TEMP_treedmg = _damage; DZE_TEMP_treedmg = _damage;
}; };

View File

@@ -84,7 +84,7 @@ if (!isDedicated) then {
player_removeAttachment = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_removeAttachment.sqf"; player_removeAttachment = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_removeAttachment.sqf";
player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf"; player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
player_makeFire = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf"; player_makeFire = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf";
player_chopWood = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf"; //player_chopWood = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf"; //Epoch uses player_harvest instead
player_mineStone = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_mineStone.sqf"; player_mineStone = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_mineStone.sqf";
if (DZE_modularBuild) then { if (DZE_modularBuild) then {
player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\modular_build.sqf"; player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\modular_build.sqf";
@@ -144,7 +144,6 @@ if (!isDedicated) then {
// EPOCH ADDITIONS // EPOCH ADDITIONS
autoRunOff = {autoRunActive = false; terminate autoRunThread; player playActionNow "Stop";}; autoRunOff = {autoRunActive = false; terminate autoRunThread; player playActionNow "Stop";};
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf"; dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
dze_getModelName = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_getModelName.sqf";
dze_isnearest_player = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_isNearestPlayer.sqf"; dze_isnearest_player = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_isNearestPlayer.sqf";
dze_surrender_off = {player setVariable ["DZE_Surrendered",false,true]; DZE_Surrender = false;}; dze_surrender_off = {player setVariable ["DZE_Surrendered",false,true]; DZE_Surrender = false;};
epoch_tempKeys = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_tempKeys.sqf"; epoch_tempKeys = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_tempKeys.sqf";
@@ -549,6 +548,7 @@ player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\c
player_bloodCalc = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\bloodCalc.sqf"; player_bloodCalc = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\bloodCalc.sqf";
fn_selectRandomLocation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandomLocation.sqf"; fn_selectRandomLocation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandomLocation.sqf";
fn_chance = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandomChance.sqf"; fn_chance = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandomChance.sqf";
fn_getModelName = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_getModelName.sqf";
fn_niceSpot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_niceSpot.sqf"; fn_niceSpot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_niceSpot.sqf";
fnc_Obj_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\obj_handleDam.sqf"; fnc_Obj_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\obj_handleDam.sqf";
object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf"; object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";

View File

@@ -153,10 +153,14 @@ if (isServer) then {
_tree = (_this select 1) select 0; _tree = (_this select 1) select 0;
_player = (_this select 1) select 1; _player = (_this select 1) select 1;
_dis = _player distance _tree; _dis = _player distance _tree;
_name = if (alive _player) then {name _player} else {"unknown"};
_uid = getPlayerUID _player;
_treeModel = _tree call fn_getModelName;
if (_dis < 30) then { if ((_dis < 30) && (_treeModel in dayz_trees) && (_uid != "")) then {
_tree setDamage 1; _tree setDamage 1;
deleteVehicle _tree; deleteVehicle _tree;
diag_log format["Server setDamage on tree %1 chopped down by %2(%3)",_treeModel,_name,_uid];
}; };
}; };

View File

@@ -52,6 +52,7 @@ DayZ_GearedObjects = ["Car","Helicopter","Motorcycle","Ship","TentStorage_base",
DayZ_RestingAnims = ["amovpsitmstpsnonwpstdnon_ground","amovpsitmstpsnonwpstdnon_smoking","amovpsitmstpsraswrfldnon_weaponcheck1","amovpsitmstpsraswrfldnon"]; DayZ_RestingAnims = ["amovpsitmstpsnonwpstdnon_ground","amovpsitmstpsnonwpstdnon_smoking","amovpsitmstpsraswrfldnon_weaponcheck1","amovpsitmstpsraswrfldnon"];
dayz_typedBags = ["bloodTester","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]; dayz_typedBags = ["bloodTester","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"];
dayz_playerAchievements = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; dayz_playerAchievements = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
dayz_trees = ["ind_timbers.p3d","t_picea2s_snow.p3d","b_corylus.p3d","t_quercus3s.p3d","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_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","str habr.p3d","brg_bird_1.p3d","brg_bird_2.p3d","brg_bird_3.p3d","brg_umbrella_acacia02b.p3d","brg_africandoumpalm_1.p3d","brg_umbrella_acacia04b.p3d","brg_datepalm_4.p3d","brg_datepalm_1.p3d","brg_umbrella_acacia03b.p3d","brg_bottle_4.p3d","brg_aloe1.p3d","brg_umbrella_acacia03.p3d","brg_umbrella_acacia01.p3d","brg_umbrella_acacia04.p3d","brg_aloe2.p3d","brg_umbrella_acacia02.p3d","brg_aloe3.p3d","brg_bottle_1.p3d","brg_datepalm_3.p3d","brg_datepalm_2.p3d","brg_baobab_1.p3d","brg_bottle_2.p3d","brg_bottle_3.p3d"];
Dayz_meatraw = Dayz_meatraw =
[ [
@@ -646,7 +647,6 @@ if (!isDedicated) then {
DZE_F = false; DZE_F = false;
DZE_cancelBuilding = false; DZE_cancelBuilding = false;
DZE_PZATTACK = false; DZE_PZATTACK = false;
DZE_trees = ["t_picea2s_snow.p3d","b_corylus.p3d","t_quercus3s.p3d","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_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","str habr.p3d","brg_bird_1.p3d","brg_bird_2.p3d","brg_bird_3.p3d","brg_umbrella_acacia02b.p3d","brg_africandoumpalm_1.p3d","brg_umbrella_acacia04b.p3d","brg_datepalm_4.p3d","brg_datepalm_1.p3d","brg_umbrella_acacia03b.p3d","brg_bottle_4.p3d","brg_aloe1.p3d","brg_umbrella_acacia03.p3d","brg_umbrella_acacia01.p3d","brg_umbrella_acacia04.p3d","brg_aloe2.p3d","brg_umbrella_acacia02.p3d","brg_aloe3.p3d","brg_bottle_1.p3d","brg_datepalm_3.p3d","brg_datepalm_2.p3d","brg_baobab_1.p3d","brg_bottle_2.p3d","brg_bottle_3.p3d"];
DZE_TEMP_treedmg = 1; DZE_TEMP_treedmg = 1;
DZE_Surrender = false; DZE_Surrender = false;
DZE_Quarantine = false; DZE_Quarantine = false;