1.0.0.9 Developer Build

+ [FIXED] Player position was saved to [] in certain areas of Taviana
forcing random spawn. Override variables added dayz_minpos (default:
-20000) and dayz_maxpos (default: 20000). To better support Taviana use
dayz_minpos = -26000; dayz_maxpos = 26000;  Thanks to dayzforever.com
admin for the heads up.
+ [ADDED] Small Desert Camo Net - desert_net_kit - Recipe: 4 x tent + 4
x metal pole
+ [ADDED] Large Desert Camo Net - desert_large_net_kit - Recipe: 3 x
desert_net_kit
+ [ADDED] Small Forest Camo Net - forest_net_kit - Recipe: 4 x tent + 4
x metal pole
+ [ADDED] Large Forest Camo Net - forest_large_net_kit - Recipe: 3 x
forest_net_kit
+ [CHANGED] changed out ItemSodaRbull with ItemSodaR4z0r due to
glitching with rbull model.
+ [ADDED] New Heavy Duty SUV with camo skin (Armor: 50) +25 increase in
armor and holds 100 magazines, 10 weapons, 5 backpacks. Camo skin from
here:
http://www.404games.co.uk/forum/index.php?/topic/1243-camo-suv-skin-code-here/
+ [ADDED] Sandbag Nest (sandbag_nest_kit) Required Tools: ItemEtool,
ItemToolbox. Recipe: ItemSandbag x 4, PartWoodPlywood x 2,
PartWoodLumber x 4.
+ [CHANGED] When selling multiple magazine items traders should now
always give highest denomination back.
+ [CHANGED] workshop is now required for most crafting. Currently a Nice
Wood Shed or a Wooden Shack will work.
+ [CHANGED] Updated camo female texture thanks to
http://www.twitch.tv/miss_alejandria
+ [ADDED] New vehicle ownership is now tied to vehicle keys. When you
purchase a new vehicle you will get a key added to your toolbelt.  Do
not drop on the ground as they are easy to loose.
+ [ADDED] Server admins can now change default fresh spawn loadout
within mission init.sqf. DefaultMagazines =
["ItemBandage","ItemPainkiller"]; DefaultWeapons = ["ItemFlashlight"];
DefaultBackpack = ""; DefaultBackpackWeapon = "";
+ [ADDED] added override variable for to change the distance for selling
vehicles. dayz_sellDistance = 20; in the missions init.sqf
+ [REVERT] Re-enabled old refuel sources and added (TODO: ability to
fill 55 gallon barrels off them).
+ [ADDED] More internal code locks and addaction locks to prevent bugged
menus.
+ [CHANGED] Can no longer drop
"MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole" from
primary slot, you must add it to your toolbelt first.
+ [ADDED]  Fishing now requires casting and waiting to catch a fish
(currently only trout).
+ [FIXED] Incorrect TradeInprogress message for Open Crate code.
+ [FIXED] Boat dealers can now use ["HeliHCivil","HeliHempty"] as
alternate spawn locations for new vehicles.
+ [FIXED] Fixed spawning of Skin_TK_INS_Warlord_EP1 needed to be
Skin_TK_INS_Warlord_EP1_DZ in loot table instead.
+ [ADDED] Gain 1 humanity for each zed you gut. only after body is
cleared and the body disappears.
+ [REMOVED] Removed m240 nest crafting for now too many problems still.
+ [ADDED] You now get a key when purchasing a vehicle,
+ [ADDED] Have your pen and paper handy for this one... When placing a
personal safe you will now get a 4 digit pin code that you will need to
use gain access to your safe.
+ [FIXED] Issues with Arma 2 free and ArmA 2 X users when purchasing
vehicles and placing vaults have now been resolved.
+ [CHANGED] Namalsk Plane vendor moved inside building, Medical vendor
moved to adjacent building.
This commit is contained in:
vbawol
2013-05-22 07:34:26 -05:00
parent f32d87b748
commit 480c2a3bc9
289 changed files with 41572 additions and 2055 deletions

View File

@@ -4,7 +4,7 @@ if(TradeInprogress) exitWith { cutText ["Boil already in progress." , "PLAIN DOW
TradeInprogress = true;
player removeAction s_player_boil;
s_player_boil = -1;
s_player_boil = 1;
_hasbottleitem = "ItemWaterbottle" in magazines player;
_hastinitem = false;
@@ -51,4 +51,6 @@ if (_hasbottleitem and _hastinitem) then {
};
};
s_player_boil = -1;
TradeInprogress = false;

View File

@@ -1,4 +1,6 @@
private["_activatingPlayer","_trader_id","_category","_action","_id","_type","_loc","_name","_qty","_cost","_qty","_sell","_cur","_order","_tid","_currency","_actionFile","_in","_out","_part","_cat","_cancel","_Display","_File","_textCurrency","_textPart"];
private ["_activatingPlayer","_trader_id","_category","_action","_type","_name","_qty","_sell","_order","_tid","_out","_part","_cancel","_Display","_File","_textCurrency","_textPart","_btype","_stype","_header","_item","_buy","_bqty","_bname","_sqty","_sname","_textCurrencySell","_afile"];
if (TradeInprogress) exitWith {}; // Do not allow if any script is running.
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
@@ -115,6 +117,6 @@ s_player_parts set [count s_player_parts,_cancel];
// Cache data in client side global variable
call compile format["tcacheBuy_%1 = %2;",_tid,dayzTraderMenuResult];
// Clear Data maybe consider cacheing results
// Clear Data
dayzTraderMenuResult = nil;
s_player_parts_crtl = 1;

View File

@@ -1,5 +1,7 @@
private["_trader_id","_category","_buy","_sell","_cancel"];
if (TradeInprogress) exitWith {}; // Do not allow if any script is running.
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
_trader_id = (_this select 3) select 0;

View File

@@ -12,7 +12,7 @@ s_player_callzombies = 1;
[player,"spotted",0,false] call dayz_zombieSpeak;
_id = [player,100,true,(getPosATL player)] spawn player_alertZombies;
[player,100,true,(getPosATL player)] spawn player_alertZombies;
// wait a bit
sleep 3;

View File

@@ -5,7 +5,7 @@ TradeInprogress = true;
// diag_log ("Cook Enabled");
player removeAction s_player_cook;
s_player_cook = -1;
s_player_cook = 1;
_rawmeat = meatraw;
_cookedmeat = meatcooked;
@@ -77,4 +77,5 @@ _cookedmeat = meatcooked;
};
} forEach _rawmeat;
s_player_cook = -1;
TradeInprogress = false;

View File

@@ -1,5 +1,9 @@
private["_obj"];
_obj = _this select 3;
player removeAction s_player_fireout;
s_player_fireout = 1;
player playActionNow "Medic";
sleep 6;
if(_obj isKindOf "Land_fire") then {
@@ -7,5 +11,4 @@ if(_obj isKindOf "Land_fire") then {
deleteVehicle _obj;
};
cutText [localize "str_fireplace_removed", "PLAIN DOWN"];
player removeAction s_player_fireout;
s_player_fireout = -1;

View File

@@ -2,4 +2,4 @@ private["_object"];
//["dayzUpdateVehicle",[_this select 3,"all"]] call callRpcProcedure;
dayzUpdateVehicle = [_this select 3,"all"];
publicVariable "dayzUpdateVehicle";
publicVariableServer "dayzUpdateVehicle";

View File

@@ -1,4 +1,8 @@
private["_item","_hasKnife","_hasKnifeBlunt","_hasHarvested","_qty","_text","_string","_type"];
if(TradeInprogress) exitWith { cutText ["Gutting animal already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_item = _this select 3;
_hasKnife = "ItemKnife" in items player;
_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
@@ -7,7 +11,7 @@ _hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = -1;
s_player_butcher = 1;
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type
@@ -79,4 +83,6 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
_string = format[localize "str_success_gutted_animal",_text,_qty];
cutText [_string, "PLAIN DOWN"];
};
};
};
s_player_butcher = -1;
TradeInprogress = false;

View File

@@ -1,4 +1,8 @@
private["_hasKnife","_qty","_item","_text","_string","_type","_loop","_meat","_timer"];
if(TradeInprogress) exitWith { cutText ["Gutting zombie already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_item = _this select 3;
_hasKnife = "ItemKnife" in items player;
_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
@@ -7,7 +11,7 @@ _hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = -1;
s_player_butcher = 1;
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type
@@ -75,4 +79,6 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
_string = format["Successfully Gutted Zombie",_text,_qty];
cutText [_string, "PLAIN DOWN"];
};
};
};
s_player_butcher = -1;
TradeInprogress = false;

View File

@@ -1,7 +1,10 @@
private["_hasFood","_item","_text","_qty"];
if(TradeInprogress) exitWith { cutText ["Fill Jerry already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
s_player_fillfuel = 1;
_fillCounter = 0;
_abort = false;
@@ -74,4 +77,7 @@ for "_x" from 1 to _qty do {
sleep 1;
if(_abort) exitWith {};
};
};
s_player_fillfuel = -1;
TradeInprogress = false;

View File

@@ -1,6 +1,9 @@
private["_vehicle"];
_vehicle = _this select 3;
if(TradeInprogress) exitWith { cutText ["Lock vehicle already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = -1;
@@ -10,3 +13,5 @@ processInitCommands;
//_vehicle lock true;
//dayzLockVehicle = [_vehicle,true];
//publicVariable "dayzLockVehicle";
TradeInprogress = false;

View File

@@ -37,6 +37,9 @@ if (_classname == "MeleeHatchet") then {
if (_classname == "MeleeMachete") then {
player addMagazine 'Machete_swing';
};
if (_classname == "MeleeFishingPole") then {
player addMagazine 'Fishing_Swing';
};
_broken = false;
if(_classname == "WoodenArrow") then {
@@ -69,7 +72,7 @@ if(_qty >= 1) then {
if (_isOk) then {
deleteVehicle _holder;
if (_classname in ["MeleeHatchet","MeleeCrowbar","MeleeMachete"]) then {
if (_classname in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
if (_type == "cfgWeapons") then {
_muzzles = getArray(configFile >> "cfgWeapons" >> _classname >> "muzzles");
@@ -93,6 +96,9 @@ if(_qty >= 1) then {
if (_classname == "MeleeMachete") then {
player removeMagazine 'Machete_swing';
};
if (_classname == "MeleeFishingPole") then {
player removeMagazine 'Fishing_Swing';
};
};
};
TradeInprogress = false;

View File

@@ -20,7 +20,7 @@ _create = getArray (_config >> "ItemActions" >> "Toolbelt" >> "output") select
_config2 = configFile >> "cfgWeapons" >> _create;
//Remove magazines if needed
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete"]) then {
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
_magType = ([] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines")) select 0;
_meleeNum = ({_x == _magType} count magazines player);
for "_i" from 1 to _meleeNum do {
@@ -44,7 +44,7 @@ if (_isOk) then {
player removeWeapon _item;
//Add magazines if needed
if (_create in ["MeleeHatchet","MeleeCrowbar","MeleeMachete"]) then {
if (_create in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
if (_create == "MeleeCrowbar") then {
player addMagazine 'crowbar_swing';
};
@@ -54,6 +54,9 @@ if (_isOk) then {
if (_create == "MeleeMachete") then {
player addMagazine 'Machete_swing';
};
if (_create == "MeleeFishingPole") then {
player addMagazine 'Fishing_Swing';
};
if (_type == "cfgWeapons") then {
_muzzles = getArray(configFile >> "cfgWeapons" >> _create >> "muzzles");
_wtype = ((weapons player) select 0);
@@ -68,7 +71,7 @@ if (_isOk) then {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
//Add magazines back
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete"]) then {
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
if (_item == "MeleeCrowbar") then {
player addMagazine 'crowbar_swing';
};
@@ -78,6 +81,9 @@ if (_isOk) then {
if (_item == "MeleeMachete") then {
player addMagazine 'Machete_swing';
};
if (_item == "MeleeFishingPole") then {
player addMagazine 'Fishing_Swing';
};
};
};
TradeInprogress = false;

View File

@@ -2,69 +2,11 @@
* Crafting by [VB]AWOL
* usage: spawn player_craftitem;
*/
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_id","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear"];
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
/*
== Canned Foods
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"FoodBioMeat"
== Drinks
"ItemSodaCoke",
"ItemSodaPepsi",
== Trash
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCokeEmpty",
"ItemSodaPepsiEmpty",
== community stuff Trash
"ItemSodaMdewEmpty",
"ItemSodaMtngreenEmpty",
"ItemSodaR4z0rEmpty",
"ItemSodaClaysEmpty",
"ItemSodaSmashtEmpty",.
"ItemSodaDrwasteEmpty",.
"ItemSodaLemonadeEmpty",.
"ItemSodaLvgEmpty",.
"ItemSodaMzlyEmpty",.
"ItemSodaRabbitEmpty"
== Raw Meats
"FoodSteakRaw",
"FoodmeatRaw",
"FoodbeefRaw",
"FoodmuttonRaw",
"FoodchickenRaw",
"FoodrabbitRaw",
"FoodbaconRaw"
== Cooked Meats
"FoodSteakCooked",
"FoodmeatCooked",
"FoodbeefCooked",
"FoodmuttonCooked",
"FoodchickenCooked",
"FoodrabbitCooked",
"FoodbaconCooked"
*/
// Removed metals:
// _recipe_ItemBronzeBar = [[["ItemBronzeBar",1] ],[["ItemCopperBar",3],["ItemTinBar",3]]];
// New item ideas:
// _recipe_FoodChickenNoodle = [["FoodchickenRaw",1],["FoodCanPasta",1],["ItemWaterbottle",1]];
// _recipe_FoodBeefBakedBeans = [["FoodbeefRaw",1],["FoodCanBakedBeans",1]];
// ItemSalt
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
@@ -88,6 +30,14 @@ if("fire" in _needNear) then {
};
};
if("workshop" in _needNear) then {
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
if(_isNear == 0) then {
_abort = true;
_reason = "workshop";
};
};
if(_abort) exitWith {
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
TradeInprogress = false;
@@ -142,7 +92,7 @@ if (_canDo) then {
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;

View File

@@ -2,69 +2,11 @@
* Crafting by [VB]AWOL
* usage: spawn player_craftitem;
*/
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_id","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear"];
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
/*
== Canned Foods
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"FoodBioMeat"
== Drinks
"ItemSodaCoke",
"ItemSodaPepsi",
== Trash
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCokeEmpty",
"ItemSodaPepsiEmpty",
== community stuff Trash
"ItemSodaMdewEmpty",
"ItemSodaMtngreenEmpty",
"ItemSodaR4z0rEmpty",
"ItemSodaClaysEmpty",
"ItemSodaSmashtEmpty",.
"ItemSodaDrwasteEmpty",.
"ItemSodaLemonadeEmpty",.
"ItemSodaLvgEmpty",.
"ItemSodaMzlyEmpty",.
"ItemSodaRabbitEmpty"
== Raw Meats
"FoodSteakRaw",
"FoodmeatRaw",
"FoodbeefRaw",
"FoodmuttonRaw",
"FoodchickenRaw",
"FoodrabbitRaw",
"FoodbaconRaw"
== Cooked Meats
"FoodSteakCooked",
"FoodmeatCooked",
"FoodbeefCooked",
"FoodmuttonCooked",
"FoodchickenCooked",
"FoodrabbitCooked",
"FoodbaconCooked"
*/
// Removed metals:
// _recipe_ItemBronzeBar = [[["ItemBronzeBar",1] ],[["ItemCopperBar",3],["ItemTinBar",3]]];
// New item ideas:
// _recipe_FoodChickenNoodle = [["FoodchickenRaw",1],["FoodCanPasta",1],["ItemWaterbottle",1]];
// _recipe_FoodBeefBakedBeans = [["FoodbeefRaw",1],["FoodCanBakedBeans",1]];
// ItemSalt
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
@@ -88,6 +30,14 @@ if("fire" in _needNear) then {
};
};
if("workshop" in _needNear) then {
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
if(_isNear == 0) then {
_abort = true;
_reason = "workshop";
};
};
if(_abort) exitWith {
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
TradeInprogress = false;
@@ -142,7 +92,7 @@ if (_canDo) then {
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;

View File

@@ -2,69 +2,11 @@
* Crafting by [VB]AWOL
* usage: spawn player_craftitem;
*/
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_id","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear"];
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
/*
== Canned Foods
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"FoodBioMeat"
== Drinks
"ItemSodaCoke",
"ItemSodaPepsi",
== Trash
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCokeEmpty",
"ItemSodaPepsiEmpty",
== community stuff Trash
"ItemSodaMdewEmpty",
"ItemSodaMtngreenEmpty",
"ItemSodaR4z0rEmpty",
"ItemSodaClaysEmpty",
"ItemSodaSmashtEmpty",.
"ItemSodaDrwasteEmpty",.
"ItemSodaLemonadeEmpty",.
"ItemSodaLvgEmpty",.
"ItemSodaMzlyEmpty",.
"ItemSodaRabbitEmpty"
== Raw Meats
"FoodSteakRaw",
"FoodmeatRaw",
"FoodbeefRaw",
"FoodmuttonRaw",
"FoodchickenRaw",
"FoodrabbitRaw",
"FoodbaconRaw"
== Cooked Meats
"FoodSteakCooked",
"FoodmeatCooked",
"FoodbeefCooked",
"FoodmuttonCooked",
"FoodchickenCooked",
"FoodrabbitCooked",
"FoodbaconCooked"
*/
// Removed metals:
// _recipe_ItemBronzeBar = [[["ItemBronzeBar",1] ],[["ItemCopperBar",3],["ItemTinBar",3]]];
// New item ideas:
// _recipe_FoodChickenNoodle = [["FoodchickenRaw",1],["FoodCanPasta",1],["ItemWaterbottle",1]];
// _recipe_FoodBeefBakedBeans = [["FoodbeefRaw",1],["FoodCanBakedBeans",1]];
// ItemSalt
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
@@ -88,6 +30,14 @@ if("fire" in _needNear) then {
};
};
if("workshop" in _needNear) then {
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
if(_isNear == 0) then {
_abort = true;
_reason = "workshop";
};
};
if(_abort) exitWith {
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
TradeInprogress = false;
@@ -142,7 +92,7 @@ if (_canDo) then {
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;

View File

@@ -2,69 +2,11 @@
* Crafting by [VB]AWOL
* usage: spawn player_craftitem;
*/
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_id","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear"];
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
/*
== Canned Foods
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"FoodBioMeat"
== Drinks
"ItemSodaCoke",
"ItemSodaPepsi",
== Trash
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCokeEmpty",
"ItemSodaPepsiEmpty",
== community stuff Trash
"ItemSodaMdewEmpty",
"ItemSodaMtngreenEmpty",
"ItemSodaR4z0rEmpty",
"ItemSodaClaysEmpty",
"ItemSodaSmashtEmpty",.
"ItemSodaDrwasteEmpty",.
"ItemSodaLemonadeEmpty",.
"ItemSodaLvgEmpty",.
"ItemSodaMzlyEmpty",.
"ItemSodaRabbitEmpty"
== Raw Meats
"FoodSteakRaw",
"FoodmeatRaw",
"FoodbeefRaw",
"FoodmuttonRaw",
"FoodchickenRaw",
"FoodrabbitRaw",
"FoodbaconRaw"
== Cooked Meats
"FoodSteakCooked",
"FoodmeatCooked",
"FoodbeefCooked",
"FoodmuttonCooked",
"FoodchickenCooked",
"FoodrabbitCooked",
"FoodbaconCooked"
*/
// Removed metals:
// _recipe_ItemBronzeBar = [[["ItemBronzeBar",1] ],[["ItemCopperBar",3],["ItemTinBar",3]]];
// New item ideas:
// _recipe_FoodChickenNoodle = [["FoodchickenRaw",1],["FoodCanPasta",1],["ItemWaterbottle",1]];
// _recipe_FoodBeefBakedBeans = [["FoodbeefRaw",1],["FoodCanBakedBeans",1]];
// ItemSalt
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
@@ -88,6 +30,14 @@ if("fire" in _needNear) then {
};
};
if("workshop" in _needNear) then {
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
if(_isNear == 0) then {
_abort = true;
_reason = "workshop";
};
};
if(_abort) exitWith {
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
TradeInprogress = false;
@@ -142,7 +92,7 @@ if (_canDo) then {
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;

View File

@@ -2,69 +2,11 @@
* Crafting by [VB]AWOL
* usage: spawn player_craftitem;
*/
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_id","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear"];
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
/*
== Canned Foods
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"FoodBioMeat"
== Drinks
"ItemSodaCoke",
"ItemSodaPepsi",
== Trash
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCokeEmpty",
"ItemSodaPepsiEmpty",
== community stuff Trash
"ItemSodaMdewEmpty",
"ItemSodaMtngreenEmpty",
"ItemSodaR4z0rEmpty",
"ItemSodaClaysEmpty",
"ItemSodaSmashtEmpty",.
"ItemSodaDrwasteEmpty",.
"ItemSodaLemonadeEmpty",.
"ItemSodaLvgEmpty",.
"ItemSodaMzlyEmpty",.
"ItemSodaRabbitEmpty"
== Raw Meats
"FoodSteakRaw",
"FoodmeatRaw",
"FoodbeefRaw",
"FoodmuttonRaw",
"FoodchickenRaw",
"FoodrabbitRaw",
"FoodbaconRaw"
== Cooked Meats
"FoodSteakCooked",
"FoodmeatCooked",
"FoodbeefCooked",
"FoodmuttonCooked",
"FoodchickenCooked",
"FoodrabbitCooked",
"FoodbaconCooked"
*/
// Removed metals:
// _recipe_ItemBronzeBar = [[["ItemBronzeBar",1] ],[["ItemCopperBar",3],["ItemTinBar",3]]];
// New item ideas:
// _recipe_FoodChickenNoodle = [["FoodchickenRaw",1],["FoodCanPasta",1],["ItemWaterbottle",1]];
// _recipe_FoodBeefBakedBeans = [["FoodbeefRaw",1],["FoodCanBakedBeans",1]];
// ItemSalt
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
@@ -88,6 +30,14 @@ if("fire" in _needNear) then {
};
};
if("workshop" in _needNear) then {
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
if(_isNear == 0) then {
_abort = true;
_reason = "workshop";
};
};
if(_abort) exitWith {
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
TradeInprogress = false;
@@ -142,7 +92,7 @@ if (_canDo) then {
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;

View File

@@ -38,7 +38,7 @@ if (["ItemSoda",_itemorignal] call fnc_inString) then {
//higher alert and sound radius
_dis=10;
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
_id = [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
};
if (_hasoutput) then{

View File

@@ -16,8 +16,10 @@ for "_i" from 1 to _meleeNum do {
player removeWeapon _item;
if (_item == "MeleeHatchet") then {_item = "ItemHatchet";};
if (_item == "MeleeCrowbar") then {_item = "ItemCrowbar";};
if (_item == "MeleeCrowbar") then {_item = "MeleeCrowbar";};
if (_item == "MeleeMachete") then {_item = "ItemMachete";};
if (_item == "MeleeFishingPole") then {_item = "MeleeFishingPole";};
_bag = createVehicle [format["WeaponHolder_%1",_item],getPosATL player,[], 0, "CAN_COLLIDE"];
_bag setdir (getDir player);
player reveal _bag;

View File

@@ -1,56 +1,58 @@
private ["_item","_isOk","_i","_objName","_objInfo","_lenInfo","_started","_finished","_sfx","_dis","_animState","_isMedic","_proceed","_counter","_objType","_limit","_itemOut","_countOut","_tree","_distance2d","_distance3d","_trees","_findNearestTree"];
/*
Fishing 1.0
spawn player_goFishing;
DayZ Epoch - By: [VB]AWOL
*/
private ["_itemOut","_position","_isOk","_counter"];
if(TradeInprogress) exitWith { cutText ["Fishing already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_item = _this;
call gear_ui_init;
// find position in front of player
// find position 5m in front of player
_position = player modeltoworld [0,5,0];
if(!(surfaceIsWater _position)) exitWith { TradeInprogress = false; cutText ["Must be near a shore or on a boat to fish." , "PLAIN DOWN"]; };
if(!(surfaceIsWater _position)) exitWith {TradeInprogress = false; cutText ["Must be near a shore or on a boat to fish." , "PLAIN DOWN"]; };
if(dayz_isSwimming) exitWith {TradeInprogress = false; cutText [localize "str_player_26", "PLAIN DOWN"]; };
if(player getVariable["combattimeout", 0] >= time) exitWith {TradeInprogress = false; cutText ["Canceled Fishing.", "PLAIN DOWN"];};
_isOk = true;
_counter = 0;
// swing fishingpole
player playActionNow "GestureSwing";
// Alert zeds
[player,10,true,(getPosATL player)] spawn player_alertZombies;
player playActionNow "Medic";
[player,20,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
[player,"fillwater",0,false] call dayz_zombieSpeak;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
while {_isOk} do {
if (_finished) then {
if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then {
_isOk = false;
cutText ["Canceled Fishing.", "PLAIN DOWN"];
} else {
sleep 2;
_itemOut = "FoodCanSardines"; // TODO replace with random raw fishes
_countOut = round(random 4);
for "_x" from 1 to _countOut do {
player addMagazine _itemOut;
// TODO: increase chance the deaper the water.
// 1% chance to catch anything
if((random 100) <= 1) then {
// Just the one fish for now
_itemOut = ["ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTuna"] call BIS_fnc_selectRandom;
player addMagazine _itemOut;
cutText ["You caught a fish.", "PLAIN DOWN"];
_isOk = false;
} else {
cutText ["Nibble... Nibble...", "PLAIN DOWN"];
_counter = _counter + 1;
if(_counter == 5) then {
_isOk = false;
};
};
};
cutText [format["You caught %1 fish.", _countOut], "PLAIN DOWN"];
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled Fishing.", "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -1,6 +1,6 @@
private ["_dir","_classname","_box","_location","_item","_config","_create_raw","_create","_qty","_type","_hasCrate","_hasTool"];
if(TradeInprogress) exitWith { cutText ["Repair already in progress." , "PLAIN DOWN"]; };
if(TradeInprogress) exitWith { cutText ["Open Crate already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_hasTool = "ItemCrowbar" in items player;

View File

@@ -1,22 +1,25 @@
/*
_item spawn player_wearClothes;
Added Female skin changes - vbawol
Added Female skin changes - DayZ Epoch - vbawol
*/
private["_item","_onLadder","_hasclothesitem","_config","_text","_isFemale","_myModel","_itemNew","_currentSex","_newSex","_model"];
if(TradeInprogress) exitWith { cutText ["Changing clothes already in progress." , "PLAIN DOWN"] };
TradeInprogress = true;
_item = _this;
call gear_ui_init;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
if (_onLadder) exitWith {TradeInprogress = false; cutText [(localize "str_player_21") , "PLAIN DOWN"]};
_hasclothesitem = _this in magazines player;
_config = configFile >> "CfgMagazines";
_text = getText (_config >> _item >> "displayName");
if (!_hasclothesitem) exitWith {cutText [format[(localize "str_player_31"),_text,"wear"] , "PLAIN DOWN"]};
if (!_hasclothesitem) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_31"),_text,"wear"] , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not change clothes while in a vehicle", "PLAIN DOWN"]};
if (vehicle player != player) exitWith {TradeInprogress = false; cutText ["You may not change clothes while in a vehicle", "PLAIN DOWN"]};
_myModel = (typeOf player);
_itemNew = "Skin_" + _myModel;
@@ -45,4 +48,5 @@ if ( (isClass(_config >> _itemNew)) ) then {
cutText ["You cannot wear a skin of the opposite sex.", "PLAIN DOWN"];
};
};
};
};
TradeInprogress = false;

View File

@@ -16,7 +16,7 @@ if(!(alive _item)) then {
sleep 1;
// player playActionNow "PutDown";
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,"gut",0,false] call dayz_zombieSpeak;

View File

@@ -1,5 +1,8 @@
private["_activatingPlayer","_trader_id","_category","_action","_id","_type","_loc","_name","_qty","_cost","_qty","_sell","_cur","_order","_tid","_currency","_actionFile","_in","_out","_part","_cat","_cancel","_Display","_File","_textCurrency","_textPart","_count"];
if(TradeInprogress) exitWith { cutText ["already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
// [ _trader_id, _category, _action ];
@@ -143,3 +146,4 @@ dayzTraderMenuResult = nil;
s_player_parts_crtl = 1;
TradeInprogress = false;

View File

@@ -1,4 +1,4 @@
private["_position","_veh","_location","_isOk","_backpack","_vehType","_trg","_key","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID"];
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_okToSell","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID"];
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
@@ -20,7 +20,7 @@ _bos = 0;
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_obj = nearestObjects [(getPosATL player), [_part_in], 20];
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
_qty = count _obj;
_bos = 1;
};
@@ -88,45 +88,74 @@ if (_qty >= _qty_in) then {
if(dayzTradeResult == "PASS") then {
if(_buy_o_sell == "buy") then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
// First select key color
_keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;
// then select number from 1 - 2500
_keyNumber = (floor(random 2500)) + 1;
// Combine to key (eg.ItemKeyYellow2494) classname
_keySelected = format[("ItemKey%1%2"),_keyColor,_keyNumber];
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;
if (_isOk and _isKeyOK) then {
_removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
if(_removed == _qty_in) then {
_dir = round(random 360);
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
if(count _helipad > 0) then {
_location = (getPosATL (_helipad select 0));
} else {
_location = [(position player),0,20,1,2,2000,0] call BIS_fnc_findSafePos;
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_location = (getPosATL _veh);
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure;
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,_keySelected];
publicVariableServer "dayzPublishVeh2";
player reveal _veh;
cutText [format[("Bought %3 for %1 %2, key added to toolbelt."),_qty_in,_textPartIn,_textPartOut], "PLAIN DOWN"];
} else {
player removeMagazine _keySelected;
};
} else {
cutText ["You do not have enough room on your toolbelt.", "PLAIN DOWN"];
};
_dir = round(random 360);
_location = [(position player),0,20,1,2,2000,0] call BIS_fnc_findSafePos;
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_location = (getPosATL _veh);
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
publicVariableServer "dayzPublishVeh2";
player reveal _veh;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
_obj = _obj select 0;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
_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;
};
deleteVehicle _obj;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
deleteVehicle _obj;
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};
};
{player removeAction _x} forEach s_player_parts;s_player_parts = [];

View File

@@ -1,4 +1,4 @@
private["_position","_veh","_location","_isOk","_backpack","_vehType","_trg","_key","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID"];
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID"];
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
@@ -68,9 +68,8 @@ if (_qty >= _qty_in) then {
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_obj = nearestObjects [(getPosATL player), [_part_in], 20];
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
_qty = count _obj;
_bos = 1;
};
if (_qty >= _qty_in) then {
@@ -88,39 +87,57 @@ if (_qty >= _qty_in) then {
if(dayzTradeResult == "PASS") then {
if(_buy_o_sell == "buy") then {
// First select key color
_keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;
// then select number from 1 - 2500
_keyNumber = (floor(random 2500)) + 1;
// Combine to key (eg.ItemKeyYellow2494) classname
_keySelected = format[("ItemKey%1%2"),_keyColor,_keyNumber];
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;
if (_isOk and _isKeyOK) then {
_removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
if(_removed == _qty_in) then {
_dir = round(random 360);
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
if(count _helipad > 0) then {
_location = (getPosATL (_helipad select 0));
} else {
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
};
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_dir = round(random 360);
_location = (getPosATL _veh);
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
if(count _helipad > 0) then {
_location = (getPosATL (_helipad select 0));
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure;
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,_keySelected];
publicVariableServer "dayzPublishVeh2";
player reveal _veh;
cutText [format[("Bought %3 for %1 %2, key added to toolbelt."),_qty_in,_textPartIn,_textPartOut], "PLAIN DOWN"];
} else {
player removeMagazine _keySelected;
};
} else {
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
cutText ["You do not have enough room on your toolbelt.", "PLAIN DOWN"];
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_location = (getPosATL _veh);
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
publicVariableServer "dayzPublishVeh2";
player reveal _veh;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
_obj = _obj select 0;
//check make sure there are no fully damaged tires fully
//check to make sure vehicle has no more than 75% average tire damage
_hitpoints = _obj call vehicle_getHitpoints;
_okToSell = true;
@@ -146,7 +163,7 @@ if (_qty >= _qty_in) then {
};
};
if(_okToSell) then {
if(_okToSell and !isNull _obj and alive _obj) then {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
@@ -182,8 +199,7 @@ if (_qty >= _qty_in) then {
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
} else {
cutText [format[("No %1 found within 20 meters."),_textPartIn] , "PLAIN DOWN"];
};
};
};
TradeInprogress = false;

View File

@@ -1,7 +1,3 @@
private["_none"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
//{player removeAction _x} forEach s_player_bank;s_player_bank = [];
s_player_parts_crtl = -1;
//s_player_bank_crtl = -1;
s_player_parts_crtl = -1;

View File

@@ -4,6 +4,8 @@ private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sel
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"] };
TradeInprogress = true;
_total_parts_out = 0;
_activatingPlayer = _this select 1;
_part_out = (_this select 3) select 0;
@@ -102,13 +104,10 @@ for "_x" from 1 to _total_trades do {
if(dayzTradeResult == "PASS") then {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
// total of all parts
_total_parts_out = _total_parts_out + _qty_out;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
@@ -144,4 +143,125 @@ for "_x" from 1 to _total_trades do {
if(_abort) exitWith {};
};
// pay out
if(_total_parts_out >= 1) then {
diag_log format["DEBUG TRADE #: %1", _total_parts_out];
if(_bos == 1) then {
//convert currency trades into next bar
// 10 ItemCopperBar > ItemCopperBar10oz
// 3 ItemCopperBar10oz > ItemSilverBar
// 10 ItemSilverBar > ItemSilverBar10oz
// 3 ItemSilverBar10oz > ItemGoldBar
// 10 ItemGoldBar > ItemGoldBar10oz
_next_highest_bar = "NA";
_third_highest_bar = "NA";
_next_highest_conv = 10000;
_third_highest_conv = 10000;
switch(true)do{
case (_part_out == "ItemCopperBar"): {
_next_highest_bar = "ItemCopperBar10oz";
_third_highest_bar = "ItemSilverBar";
_next_highest_conv = 10;
_third_highest_conv = 3;
};
case (_part_out == "ItemCopperBar10oz"): {
_next_highest_bar = "ItemSilverBar";
_third_highest_bar = "ItemSilverBar10oz";
_next_highest_conv = 3;
_third_highest_conv = 10;
};
case (_part_out == "ItemSilverBar"): {
_next_highest_bar = "ItemSilverBar10oz";
_third_highest_bar = "ItemGoldBar";
_next_highest_conv = 10;
_third_highest_conv = 3;
};
case (_part_out == "ItemSilverBar10oz"): {
_next_highest_bar = "ItemGoldBar";
_third_highest_bar = "ItemGoldBar10oz";
_next_highest_conv = 3;
_third_highest_conv = 10;
};
case (_part_out == "ItemGoldBar"): {
_next_highest_bar = "ItemGoldBar10oz";
_third_highest_bar = "NA";
_next_highest_conv = 10;
_third_highest_conv = 10000;
};
};
diag_log format["DEBUG TRADE part: %1 next: %2", _part_out,_next_highest_bar];
if(_total_parts_out >= _next_highest_conv) then {
_next_parts_out_raw = _total_parts_out / _next_highest_conv;
// whole parts
_next_parts_out = floor(_next_parts_out_raw);
diag_log format["DEBUG TRADE next whole parts: %1 part: %2", _next_parts_out,_next_highest_bar];
// find any whole remains
_remainder = floor((_next_parts_out_raw - _next_parts_out) * _next_highest_conv);
diag_log format["DEBUG TRADE remainder parts: %1 part: %2", _remainder,_part_out];
for "_x" from 1 to _remainder do {
player addMagazine _part_out;
};
// Find if needs further conversion
if (_next_parts_out >= _third_highest_conv) then {
_third_parts_out_raw = _next_parts_out / _third_highest_conv;
// whole parts
_third_parts_out = floor(_third_parts_out_raw);
diag_log format["DEBUG TRADE third whole parts: %1 part: %2", _third_parts_out,_third_highest_bar];
for "_x" from 1 to _third_parts_out do {
player addMagazine _third_highest_bar;
};
// find any whole remains
_remainder = floor((_third_parts_out_raw - _third_parts_out) * _third_highest_conv);
diag_log format["DEBUG TRADE remainder parts: %1 part: %2", _remainder,_next_highest_bar];
for "_x" from 1 to _remainder do {
player addMagazine _next_highest_bar;
};
} else {
diag_log format["DEBUG TRADE next parts: %1 part: %2", _next_parts_out,_next_highest_bar];
for "_x" from 1 to _next_parts_out do {
player addMagazine _next_highest_bar;
};
};
} else {
diag_log "DEBUG TRADE SELLING NORMALLY";
for "_x" from 1 to _total_parts_out do {
player addMagazine _part_out;
};
};
} else {
diag_log "DEBUG TRADE BUYING";
for "_x" from 1 to _total_parts_out do {
player addMagazine _part_out;
};
};
};
TradeInprogress = false;

View File

@@ -1,5 +1,8 @@
private["_none"];
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = 1;
@@ -30,3 +33,4 @@ _metals_conversion = [
_cancel = player addAction ["Cancel", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
s_player_parts set [count s_player_parts,_cancel];
TradeInprogress = false;

View File

@@ -0,0 +1,12 @@
private ["_buy","_number"];
dayz_selectedVault = _this select 3;
dayz_combination = "";
_number = 0;
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
for "_x" from 1 to 10 do {
_buy = player addAction [str(_number), "\z\addons\dayz_code\actions\vault_combination_2.sqf",str(_number), 99, true, false, "",""];
s_player_combi set [count s_player_combi,_buy];
_number = _number + 1;
};

View File

@@ -0,0 +1,15 @@
private ["_buy","_number"];
// start combination string build
dayz_combination = _this select 3;
_number = 0;
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
for "_x" from 1 to 10 do {
_buy = player addAction [str(_number), "\z\addons\dayz_code\actions\vault_combination_3.sqf",str(_number), 99, true, false, "",""];
s_player_combi set [count s_player_combi,_buy];
_number = _number + 1;
};

View File

@@ -0,0 +1,15 @@
private ["_buy","_number"];
// combine previous selections with next
dayz_combination = format["%1%2",dayz_combination,(_this select 3)];
_number = 0;
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
for "_x" from 1 to 10 do {
_buy = player addAction [str(_number), "\z\addons\dayz_code\actions\vault_combination_4.sqf",str(_number), 99, true, false, "",""];
s_player_combi set [count s_player_combi,_buy];
_number = _number + 1;
};

View File

@@ -0,0 +1,15 @@
private ["_buy","_number"];
// combine previous selections with next
dayz_combination = format["%1%2",dayz_combination,(_this select 3)];
_number = 0;
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
for "_x" from 1 to 10 do {
_buy = player addAction [str(_number), "\z\addons\dayz_code\actions\vault_combination_final.sqf",str(_number), 99, true, false, "",""];
s_player_combi set [count s_player_combi,_buy];
_number = _number + 1;
};

View File

@@ -0,0 +1,10 @@
private [];
// set final combination to player
dayz_combination = format["%1%2",dayz_combination,(_this select 3)];
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
s_player_unlockvault = -1;
// Run unlock on vault
if(!isNull dayz_selectedVault and (typeOf dayz_selectedVault) == "VaultStorageLocked") then {
dayz_selectedVault spawn player_unlockVault;
dayz_selectedVault = objNull;
};

View File

@@ -1,3 +1,3 @@
private["_obj","_bag","_pos"];
private ["_obj"];
_obj = _this select 3;
_obj spawn player_unlockVault;

View File

@@ -1,3 +1,3 @@
private["_obj","_bag","_pos"];
private ["_obj"];
_obj = _this select 3;
_obj spawn player_lockVault;

View File

@@ -1,3 +1,3 @@
private["_obj","_bag","_pos"];
private ["_obj"];
_obj = _this select 3;
_obj spawn player_packVault;

View File

@@ -1,4 +1,4 @@
private ["_tent","_location","_isOk","_cancel","_location3","_location4","_location1","_location2","_counter","_pondPos","_isPond","_ppos","_hastentitem","_dir","_id","_building","_isBuilding","_playerPos","_item","_offset_x","_offset_y","_offset_z","_offset_z_attach","_config","_text","_tmpvault","_vault_location","_objectsPond"];
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
if(TradeInprogress) exitWith { cutText ["Vault pitching already in progress." , "PLAIN DOWN"]; };
@@ -108,47 +108,60 @@ if(!_cancel) then {
_hastentitem = _this in magazines player;
if (!_hastentitem) exitWith {cutText [format[(localize "str_player_31"),_text,"pitch"] , "PLAIN DOWN"]};
player removeMagazine _item;
_removed = ([player,_item] call BIS_fnc_invRemove);
//call dayz_forceSave;
if(_removed == 1) then {
_dir = round(direction player);
//wait a bit
player playActionNow "Medic";
sleep 1;
[player,"tentunpack",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_building = nearestObject [(vehicle player), "HouseBase"];
_isBuilding = [(vehicle player),_building] call fnc_isInsideBuilding;
player removeMagazine _item;
if(_isBuilding) then {
//call dayz_forceSave;
_dir = round(direction player);
//wait a bit
player playActionNow "Medic";
sleep 1;
[player,"tentunpack",0,false] call dayz_zombieSpeak;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
_building = nearestObject [(vehicle player), "HouseBase"];
_isBuilding = [(vehicle player),_building] call fnc_isInsideBuilding;
if(_isBuilding) then {
_ppos = _building worldToModel _vault_location;
_location = _building modelToWorld _ppos;
_ppos = _building worldToModel _vault_location;
_location = _building modelToWorld _ppos;
} else {
_location = player modelToWorld [_offset_x,_offset_y,_offset_z];
} else {
_location = player modelToWorld [_offset_x,_offset_y,_offset_z];
};
sleep 5;
//place tent (local)
_tent = createVehicle ["VaultStorageLocked", _location, [], 0, "CAN_COLLIDE"];
_tent setdir _dir;
_tent setpos _location;
player reveal _tent;
// Generate Combination
_combination_1 = floor(random 10);
_combination_2 = floor(random 10);
_combination_3 = floor(random 10);
_combination_4 = floor(random 10);
// Format Combination
_combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4];
_tent setVariable ["characterID",_combination,true];
_tent setVariable ["OEMPos",_location,true];
//["dayzPublishObj",[_combination,_tent,[_dir,_location],"VaultStorageLocked"]] call callRpcProcedure;
dayzPublishObj = [_combination,_tent,[_dir,_location],"VaultStorageLocked"];
publicVariableServer "dayzPublishObj";
cutText [format["You have setup your Safe. Combination is %1",_combination], "PLAIN DOWN", 5];
};
sleep 5;
//place tent (local)
_tent = createVehicle ["VaultStorageLocked", _location, [], 0, "CAN_COLLIDE"];
_tent setdir _dir;
_tent setpos _location;
player reveal _tent;
_tent setVariable ["characterID",dayz_playerUID,true];
_tent setVariable ["OEMPos",_location,true];
//["dayzPublishObj",[dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"]] call callRpcProcedure;
dayzPublishObj = [dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"];
publicVariableServer "dayzPublishObj";
cutText ["You have setup your Safe", "PLAIN DOWN"];
} else {
cutText ["You cannot place a Safe here. The area must be flat, and free of other objects", "PLAIN DOWN"];

View File

@@ -1,3 +1,3 @@
private["_obj","_bag","_pos"];
private ["_obj"];
_obj = _this select 3;
_obj spawn player_unlockVault;