1.0.1.6 Developer Build

This commit is contained in:
[VB]AWOL
2013-07-30 21:52:28 -05:00
parent e333adff4f
commit b2b79305f7
42 changed files with 791 additions and 438 deletions

View File

@@ -58,8 +58,6 @@ _cookedmeat = meatcooked;
if (_finished) then {
_removed = _removed + ([player,_meat,_qty] call BIS_fnc_invRemove);
// Add only number of items removed
for "_x" from 1 to _removed do {
player addMagazine _meatcooked;
};

View File

@@ -27,8 +27,9 @@ switch (_type) do {
};
case 1: {
player removeMagazine "ItemWaterbottle";
player addMagazine "ItemWaterbottleUnfilled";
if(([player,"ItemWaterbottle"] call BIS_fnc_invRemove) == 1) then {
player addMagazine "ItemWaterbottleUnfilled";
};
_handle setFSMVariable ["_thirst",0];
player removeAction s_player_waterdog;
s_player_waterdog = -1;

View File

@@ -54,7 +54,6 @@ if (_finished) then {
if(!(_vehicle getVariable ["GeneratorFilled", false]) and ("ItemJerrycan" in magazines player)) then {
if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then {
player addMagazine "ItemJerrycanEmpty";
// mark as once filled

View File

@@ -3,6 +3,9 @@ private ["_item","_hasKnife","_hasKnifeBlunt","_hasHarvested","_qty","_text","_s
if(TradeInprogress) exitWith { cutText ["Gutting animal already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
player removeAction s_player_butcher;
s_player_butcher = 1;
_item = _this select 3;
_hasKnife = "ItemKnife" in items player;
_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
@@ -10,9 +13,6 @@ _type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = 1;
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type
_isListed = isClass (_config);
@@ -73,15 +73,10 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
if (_hasKnifeBlunt) then { _qty = round(_qty / 2); };
_array = [_item,_qty];
if (local _item) then {
_array spawn local_gutObject;
} else {
dayzGutBody = _array;
publicVariable "dayzGutBody";
};
dayzGutBody = [_item,_qty];
dayzGutBody spawn local_gutObject;
publicVariable "dayzGutBody";
_string = format[localize "str_success_gutted_animal",_text,_qty];
cutText [_string, "PLAIN DOWN"];
};

View File

@@ -3,6 +3,9 @@ private ["_hasKnife","_qty","_item","_text","_string","_type","_started","_finis
if(TradeInprogress) exitWith { cutText ["Gutting zombie already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
player removeAction s_player_butcher;
s_player_butcher = 1;
_item = _this select 3;
_hasKnife = "ItemKnife" in items player;
_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
@@ -10,9 +13,6 @@ _type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
//_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = 1;
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type
//_loop = true;
@@ -69,14 +69,9 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
_qty = 1;
_array = [_item,_qty];
if (local _item) then {
_array spawn local_gutObjectZ;
} else {
dayzGutBody = _array;
publicVariable "dayzGutBodyZ";
};
dayzGutBody = [_item,_qty];
dayzGutBody spawn local_gutObjectZ;
publicVariable "dayzGutBodyZ";
// Reduce humanity for gutting zeds
_humanity = player getVariable["humanity",0];

View File

@@ -3,12 +3,12 @@ private ["_array","_type","_classname","_holder","_config","_isOk","_muzzles","_
// Exit if player zombie
if(player isKindOf "PZombie_VB") exitWith {};
if(TradeInprogress) exitWith { cutText ["Take item already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
// Test cannot lock while another player is nearby
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]) > 1;
if(_playerNear) exitWith { TradeInprogress = false; cutText ["Cannot take item while another player is nearby." , "PLAIN DOWN"]; };
// _playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]) > 1;
// if(_playerNear) exitWith {cutText ["Cannot take item while another player is nearby." , "PLAIN DOWN"]; };
if (!DZE_CanPickup) exitWith { cutText ["Take item already in progress." , "PLAIN DOWN"]; };
DZE_CanPickup = false;
_array = _this select 3;
_type = _array select 0;
@@ -29,9 +29,10 @@ if (_claimedBy == "0" or !_playerNear) then {
_holder setVariable["claimed",_playerID,true];
};
if(_classname isKindOf "TrapBear") exitwith {TradeInprogress = false; deleteVehicle _holder;};
if(_classname isKindOf "TrapBear") exitwith {DZE_CanPickup = true; deleteVehicle _holder;};
player playActionNow "PutDown";
if (_classname == "MeleeCrowbar") then {
player addMagazine 'crowbar_swing';
};
@@ -45,26 +46,18 @@ if (_classname == "MeleeFishingPole") then {
player addMagazine 'Fishing_Swing';
};
_broken = false;
if(_classname == "WoodenArrow") then {
if (20 > random 100) then {
_broken = true;
};
};
if (_broken) exitWith { deleteVehicle _holder; TradeInprogress = false; cutText [localize "str_broken_arrow", "PLAIN DOWN"] };
sleep 1;
_claimedBy = _holder getVariable["claimed","0"];
if (_claimedBy != _playerID) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_beinglooted"),_text] , "PLAIN DOWN"]};
if (_claimedBy != _playerID) exitWith {sleep 1; DZE_CanPickup = true; cutText [format[(localize "str_player_beinglooted"),_text] , "PLAIN DOWN"]};
if(_classname isKindOf "Bag_Base_EP1") then {
diag_log("Picked up a bag: " + _classname);
};
// test to see if item still exists just before adding and removing
if(isNull _holder) exitWith { TradeInprogress = false; };
if(isNull _holder) exitWith { sleep 1; DZE_CanPickup = true; };
_obj = nearestObjects [(getPosATL player), [(typeOf _holder)], 5];
_qty = count _obj;
@@ -105,4 +98,6 @@ if(_qty >= 1) then {
};
};
};
TradeInprogress = false;
sleep 1;
DZE_CanPickup = true;

View File

@@ -1,3 +1,7 @@
/*
DayZ Base Building
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_isBuilding","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_buildings","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole"];
if(TradeInprogress) exitWith { cutText ["Building already in progress." , "PLAIN DOWN"]; };
@@ -18,14 +22,11 @@ if(player getVariable["combattimeout", 0] >= time) exitWith {TradeInprogress = f
_item = _this;
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
_require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
_needNearby = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "needNearby");
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
_isPole = (_classname == "Plastic_Pole_EP1_DZ");
_isWorkBench = (_classname == "WorkBench_DZ");
_distance = 30;
_needText = "Plot Pole";
@@ -34,36 +35,24 @@ if(_isPole) then {
_distance = 45;
};
if((count _needNearby) == 0) then {
_needNearby = ["Plastic_Pole_EP1_DZ"];
} else {
if("dayz_fuelpumparray" in _needNearby) then {
_needNearby = dayz_fuelpumparray;
_needText = "Fuel Pump";
};
if("dayz_fuelsources" in _needNearby) then {
_needNearby = dayz_fuelsources;
_needText = "Fuel Tanks";
};
};
// check for near plot
_findNearestPoles = nearestObjects [(vehicle player), _needNearby, _distance];
_findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
_findNearestPole = [];
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} foreach _findNearestPoles;
{
if (alive _x) then {
_findNearestPole set [(count _findNearestPole),_x];
};
} foreach _findNearestPoles;
_IsNearPlot = count (_findNearestPole);
// If item is plot pole and another one exists within 45m
if(_isPole and _IsNearPlot > 0) exitWith { TradeInprogress = false; cutText ["Cannot build plot pole within 45m of an existing plot." , "PLAIN DOWN"]; };
if(_IsNearPlot == 0) then {
// Allow building of plot
if(_isPole or _isWorkBench) then {
_canBuildOnPlot = true;
};
_canBuildOnPlot = true;
} else {
// Since there are plots nearby we check for ownership and then for friend status
@@ -121,7 +110,22 @@ if (_hasrequireditem) then {
_position = player modeltoworld _offset;
_position = [(_position select 0),(_position select 1), 0];
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
if(isText (configFile >> "CfgVehicles" >> _classname >> "GhostPreview")) then {
_ghost = getText(configFile >> "CfgVehicles" >> _classname >> "GhostPreview");
};
// if ghost preview available use that instead
if(_ghost != "") then {
_classnametmp = _classname;
_classname = _ghost;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_classname = _classnametmp;
} else {
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
};
_object setDir _dir;

View File

@@ -39,9 +39,10 @@ if ( (isClass(_config >> _itemNew)) ) then {
// Get model name from config
_model = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "playerModel");
if (_model != _myModel) then {
player removeMagazine _item;
player addMagazine _itemNew;
[dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
if(([player,_item] call BIS_fnc_invRemove) == 1) then {
player addMagazine _itemNew;
[dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
};
};
} else {

View File

@@ -106,17 +106,12 @@ _availableCans = ["ItemJerrycan","ItemFuelBarrel"];
if(([player,_canName] call BIS_fnc_invRemove) == 1) then {
dayzSetFuel = [_vehicle,_newFuel];
if (local _vehicle) then {
dayzSetFuel spawn local_setFuel;
};
dayzSetFuel spawn local_setFuel;
publicVariable "dayzSetFuel";
// Play sound
[player,"refuel",0,false] call dayz_zombieSpeak;
// Add filled can
player addMagazine _canName+"Empty";
cutText [format[localize "str_player_05",_nameText,_canSize], "PLAIN DOWN"];
call fnc_usec_medic_removeActions;

View File

@@ -119,10 +119,7 @@ _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
// Play sound
[player,"refuel",0,false] call dayz_zombieSpeak;
// Add filled can
player addMagazine _canName;
cutText [format["%1 has been drained for %2 litres of Fuel",_nameText,_canSize], "PLAIN DOWN"];
call fnc_usec_medic_removeActions;

View File

@@ -147,7 +147,6 @@ if (_qty >= _qty_in) then {
_okToSell = true;
if(_okToSell and !isNull _obj and alive _obj) then {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};

View File

@@ -172,7 +172,7 @@ if (_qty >= _qty_in) then {
if(_okToSell) then {
if(!isNull _obj and alive _obj) then {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};

View File

@@ -1,3 +1,7 @@
/*
DayZ Safe
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_tent","_location","_isOk","_cancel","_location3","_location4","_location1","_location2","_counter","_pondPos","_isPond","_ppos","_hastentitem","_dir","_building","_isBuilding","_playerPos","_item","_offset_x","_offset_y","_offset_z","_offset_z_attach","_config","_text","_tmpvault","_vault_location","_objectsPond","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_removed"];
//check if can pitch here

View File

@@ -51,8 +51,9 @@ if (_canFill) then {
if ("ItemWaterbottleUnfilled" in magazines player) then {
for "_x" from 1 to _qty do {
player removeMagazine "ItemWaterbottleUnfilled";
player addMagazine "ItemWaterbottle";
if(([player,"ItemWaterbottleUnfilled"] call BIS_fnc_invRemove) == 1) then {
player addMagazine "ItemWaterbottle";
};
};
_dis=5;