+ Fixed females unable to select gender after death.
+ Fixed Alice and Assault packs inventory issues created with last
patch.
+ Fixed being unable to take items that may have already been claimed by
another player. Should work if no other players are within 6 meters.
+ Cooking, Crafting, Repairing, and Salvaging all now require full Medic
animation cycle to complete. You can cancel the process just by moving.
+ Traders that deal with magazine items now require full Medic animation
cycle per trade. Also, number of possible trades now based on quantity
of available items being sold or cost divided by available bars.
+ Changed several PublicVariable calls from 1.7.6.1 code sync that
should have been PublicVariableServer.
+ Fixed Bio-meat was not causing infection and increased chance of
infection from "Bad Food" to 50/50.
+ Added distance checks (5m) for player zombie attacks.
+ Fixed player zombie was unable to feed.
This commit is contained in:
vbawol
2013-03-15 12:17:18 -05:00
parent c4ea450657
commit 21291e389e
26 changed files with 521 additions and 384 deletions

View File

@@ -19,9 +19,6 @@ if (_ammo != "") then {
_vehicle addMagazineTurret [_ammo,_turret]; _vehicle addMagazineTurret [_ammo,_turret];
player removeMagazine _ammo; player removeMagazine _ammo;
//disableSerialization;
//call dayz_forceSave;
cutText [format["You have successfully loaded %1 ammunition.",_ammoType], "PLAIN DOWN"]; cutText [format["You have successfully loaded %1 ammunition.",_ammoType], "PLAIN DOWN"];
} else { } else {
cutText [format["You need %1 type of ammo to do this.",_text], "PLAIN DOWN"]; cutText [format["You need %1 type of ammo to do this.",_text], "PLAIN DOWN"];

View File

@@ -1,5 +1,8 @@
private["_hasbottleitem","_hastinitem","_bottletext","_tin1text","_tin2text","_tintext","_qty","_dis","_sfx"]; private["_hasbottleitem","_hastinitem","_bottletext","_tin1text","_tin2text","_tintext","_qty","_dis","_sfx"];
if(TradeInprogress) exitWith { cutText ["Boil already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
player removeAction s_player_boil; player removeAction s_player_boil;
s_player_boil = -1; s_player_boil = -1;
@@ -16,12 +19,17 @@ _bottletext = getText (configFile >> "CfgMagazines" >> "ItemWaterbottle" >> "dis
_tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName"); _tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName");
_tin2text = getText (configFile >> "CfgMagazines" >> "ItemSodaEmpty" >> "displayName"); _tin2text = getText (configFile >> "CfgMagazines" >> "ItemSodaEmpty" >> "displayName");
_tintext = format["%1 / %2",_tin1text,_tin2text]; _tintext = format["%1 / %2",_tin1text,_tin2text];
if (!_hasbottleitem) exitWith {cutText [format[(localize "str_player_31"),_bottletext,"fill"] , "PLAIN DOWN"]}; if (!_hasbottleitem) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_31"),_bottletext,"fill"] , "PLAIN DOWN"]};
if (!_hastinitem) exitWith {cutText [format[(localize "str_player_31"),_tintext,"fill"] , "PLAIN DOWN"]}; if (!_hastinitem) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_31"),_tintext,"fill"] , "PLAIN DOWN"]};
_removed = 0;
if (_hasbottleitem and _hastinitem) then { if (_hasbottleitem and _hastinitem) then {
_qty = {_x == "ItemWaterbottle"} count magazines player; _qty = {_x == "ItemWaterbottle"} count magazines player;
if ("ItemWaterbottle" in magazines player) then { if ("ItemWaterbottle" in magazines player) then {
_removed = _removed + ([player,"ItemWaterbottle",_qty] call BIS_fnc_invRemove);
player playActionNow "Medic"; player playActionNow "Medic";
sleep 1; sleep 1;
@@ -31,17 +39,16 @@ if (_hasbottleitem and _hastinitem) then {
[player,_dis,true,(getPosATL player)] spawn player_alertZombies; [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 5; sleep 5;
for "_x" from 1 to _qty do {
player removeMagazine "ItemWaterbottle"; // Add back only number of removed
for "_x" from 1 to _removed do {
player addMagazine "ItemWaterbottleBoiled"; player addMagazine "ItemWaterbottleBoiled";
}; };
//disableSerialization;
//call dayz_forceSave;
cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"]; cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"];
} else { } else {
cutText [(localize "str_player_02") , "PLAIN DOWN"]; cutText [(localize "str_player_02") , "PLAIN DOWN"];
}; };
}; };
TradeInprogress = false;

View File

@@ -1,18 +1,27 @@
private["_config","_item","_text","_rawmeat","_cookedmeat","_meat","_meatcooked","_qty","_id"]; private["_config","_item","_text","_rawmeat","_cookedmeat","_meat","_meatcooked","_qty","_id"];
diag_log ("Cook Enabled"); if(TradeInprogress) exitWith { cutText ["Cooking already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
// diag_log ("Cook Enabled");
player removeAction s_player_cook; player removeAction s_player_cook;
s_player_cook = -1; s_player_cook = -1;
_rawmeat = meatraw; _rawmeat = meatraw;
_cookedmeat = meatcooked; _cookedmeat = meatcooked;
{ {
_meat = _x; _meat = _x;
_meatcooked = _cookedmeat select (_rawmeat find _meat); _meatcooked = _cookedmeat select (_rawmeat find _meat);
_removed = 0;
if (_meat in magazines player) then { if (_meat in magazines player) then {
_text = getText (configFile >> "CfgMagazines" >> _meatcooked >> "displayName"); _text = getText (configFile >> "CfgMagazines" >> _meatcooked >> "displayName");
cutText [format["Started cooking %1 of %2",_qty,_text], "PLAIN DOWN"];
_qty = {_x == _meat} count magazines player; _qty = {_x == _meat} count magazines player;
player playActionNow "Medic"; player playActionNow "Medic";
_dis=6; _dis=6;
@@ -20,15 +29,51 @@ _cookedmeat = meatcooked;
[player,_sfx,0,false,_dis] call dayz_zombieSpeak; [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies; [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep _qty; r_interrupt = false;
for "_x" from 1 to _qty do { _animState = animationState player;
player removeMagazine _meat; r_doLoop = true;
player addMagazine _meatcooked; _started = false;
if !(_meat in magazines player) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]}; _finished = false;
};
//disableSerialization;
//call dayz_forceSave;
cutText [format[(localize "str_success_cooked"),_qty,_text], "PLAIN DOWN"]; 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;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
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;
};
cutText [format[(localize "str_success_cooked"),_qty,_text], "PLAIN DOWN"];
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText [format["Canceled cooking %1 of %2",_qty,_text], "PLAIN DOWN"];
// player addMagazine "ItemBandage";
};
}; };
} forEach _rawmeat; } forEach _rawmeat;
TradeInprogress = false;

View File

@@ -1,4 +1,8 @@
private["_array","_type","_classname","_holder","_config","_isOk","_muzzles","_playerID","_claimedBy","_text","_control","_dialog","_item","_val","_max","_bolts","_quivers","_quiver","_broken"]; private["_array","_type","_classname","_holder","_config","_isOk","_muzzles","_playerID","_claimedBy","_text","_control","_dialog","_item","_val","_max","_bolts","_quivers","_quiver","_broken"];
if(TradeInprogress) exitWith { cutText ["Take item already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_array = _this select 3; _array = _this select 3;
_type = _array select 0; _type = _array select 0;
_classname = _array select 1; _classname = _array select 1;
@@ -9,15 +13,16 @@ _text = getText (configFile >> _type >> _classname >> "displayName");
_claimedBy = _holder getVariable["claimed","0"]; _claimedBy = _holder getVariable["claimed","0"];
// Check if any players are nearby if not allow player to claim item.
_playerNear = {isPlayer _x} count (player nearEntities ["AllVehicles", 6]) > 1;
// Only allow if not already claimed. // Only allow if not already claimed.
if (_claimedBy == "0") then { if (_claimedBy == "0" or !_playerNear) then {
// Since item was not claimed proceed with claiming it. // Since item was not claimed proceed with claiming it.
_holder setVariable["claimed",_playerID,true]; _holder setVariable["claimed",_playerID,true];
}; };
if(_classname isKindOf "TrapBear") exitwith {TradeInprogress = false; deleteVehicle _holder;};
if(_classname isKindOf "TrapBear") exitwith {deleteVehicle _holder;};
player playActionNow "PutDown"; player playActionNow "PutDown";
if (_classname == "MeleeCrowbar") then { if (_classname == "MeleeCrowbar") then {
@@ -30,20 +35,19 @@ if (_classname == "MeleeMachete") then {
player addMagazine 'Machete_swing'; player addMagazine 'Machete_swing';
}; };
_broken = false; _broken = false;
if(_classname == "WoodenArrow") then { if(_classname == "WoodenArrow") then {
if (20 > random 100) then { if (20 > random 100) then {
_broken = true; _broken = true;
}; };
}; };
if (_broken) exitWith { deleteVehicle _holder; cutText [localize "str_broken_arrow", "PLAIN DOWN"] }; if (_broken) exitWith { deleteVehicle _holder; TradeInprogress = false; cutText [localize "str_broken_arrow", "PLAIN DOWN"] };
sleep 1; sleep 1;
_claimedBy = _holder getVariable["claimed","0"]; _claimedBy = _holder getVariable["claimed","0"];
if (_claimedBy != _playerID) exitWith {cutText [format[(localize "str_player_beinglooted"),_text] , "PLAIN DOWN"]}; if (_claimedBy != _playerID) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_beinglooted"),_text] , "PLAIN DOWN"]};
if(_classname isKindOf "Bag_Base_EP1") then { if(_classname isKindOf "Bag_Base_EP1") then {
diag_log("Picked up a bag: " + _classname); diag_log("Picked up a bag: " + _classname);
@@ -78,4 +82,4 @@ if (_isOk) then {
player removeMagazine 'Machete_swing'; player removeMagazine 'Machete_swing';
}; };
}; };
TradeInprogress = false;

View File

@@ -1,13 +1,17 @@
private["_item","_config","_onLadder","_create","_isOk","_config2","_consume"]; private["_item","_config","_onLadder","_create","_isOk","_config2","_consume"];
if(TradeInprogress) exitWith { cutText ["Add to toolbelt already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_item = _this; _item = _this;
_config = configFile >> "cfgWeapons" >> _item; _config = configFile >> "cfgWeapons" >> _item;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; _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"]};
_hastoolweapon = _this in weapons player; _hastoolweapon = _this in weapons player;
_text = getText (_config >> "displayName"); _text = getText (_config >> "displayName");
if (!_hastoolweapon) exitWith {cutText [format[(localize "str_player_30"),_text] , "PLAIN DOWN"]}; if (!_hastoolweapon) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_30"),_text] , "PLAIN DOWN"]};
call gear_ui_init; call gear_ui_init;
@@ -76,3 +80,4 @@ if (_isOk) then {
}; };
}; };
}; };
TradeInprogress = false;

View File

@@ -1,5 +1,8 @@
private["_location","_isOk","_dir","_classname"]; private["_item","_location","_isOk","_dir","_classname"];
private["_item"];
if(TradeInprogress) exitWith { cutText ["Harvest wood already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_item = _this; _item = _this;
call gear_ui_init; call gear_ui_init;
@@ -17,3 +20,5 @@ if (["forest",dayz_surfaceType] call fnc_inString) then {
} else { } else {
cutText [localize "str_player_23", "PLAIN DOWN"]; cutText [localize "str_player_23", "PLAIN DOWN"];
}; };
TradeInprogress = false;

View File

@@ -2,7 +2,7 @@
* Crafting by [VB]AWOL * Crafting by [VB]AWOL
* usage: spawn player_craftitem; * usage: spawn player_craftitem;
*/ */
private["_onLadder","_canDo","_recipe_ItemTinBar","_recipe_ItemAluminumBar","_recipe_ItemBronzeBar","_recipe_ItemGoldBar10oz","_recipe_ItemGoldBar","_recipe_FoodChickenNoodle","_recipe_FoodBeefBakedBeans","_item","_config","_create","_selectedRecipe","_recipe_","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut"]; private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_text","_id","_textMissing","_selectedRecipeInput"];
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; }; if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true; TradeInprogress = true;
@@ -100,59 +100,92 @@ if (inflamed cursorTarget and _canDo) then {
// If all parts proceed // If all parts proceed
if (_proceed) then { if (_proceed) then {
_removed = 0; // count total of removed items cutText ["Crafting started", "PLAIN DOWN"];
_tobe_removed_total = 0; // count total of all to be removed items
// Take items
{
_itemIn = _x select 0;
_countIn = _x select 1;
diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
_tobe_removed_total = _tobe_removed_total + _countIn;
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,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;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (_finished) then {
_removed = 0; // count total of removed items
_tobe_removed_total = 0; // count total of all to be removed items
// Take items
{ {
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then { _itemIn = _x select 0;
_countIn = _x select 1;
diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
_tobe_removed_total = _tobe_removed_total + _countIn;
// diag_log format["removing: %1 kindOf: %2", _x, _itemIn]; {
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
// player removeMagazine _x; // diag_log format["removing: %1 kindOf: %2", _x, _itemIn];
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
};
} forEach magazines player; // player removeMagazine _x;
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
};
} forEach _selectedRecipeInput; } forEach magazines player;
diag_log format["removing: %1 kindOf: %2", _removed, _tobe_removed_total]; } forEach _selectedRecipeInput;
// Only proceed if all parts were removed successfully diag_log format["removing: %1 kindOf: %2", _removed, _tobe_removed_total];
if(_removed == _tobe_removed_total) then {
player playActionNow "Medic"; // Only proceed if all parts were removed successfully
sleep 1; if(_removed == _tobe_removed_total) then {
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
// Put items // Put items
{ {
_itemOut = _x select 0; _itemOut = _x select 0;
_countOut = _x select 1; _countOut = _x select 1;
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut]; diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
for "_x" from 1 to _countOut do { for "_x" from 1 to _countOut do {
player addMagazine _itemOut; player addMagazine _itemOut;
}; };
} forEach _selectedRecipeOutput; // get display name
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
// get display name // Add crafted item
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName"); cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
// Add crafted item } forEach _selectedRecipeOutput;
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
} else {
cutText [format["Missing Parts after first check Item: %1 / %2",_removed,_tobe_removed_total], "PLAIN DOWN"];
};
} else { } else {
cutText [format["Missing Parts after first check Item: %1 / %2",_removed,_tobe_removed_total], "PLAIN DOWN"]; r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled crafting.", "PLAIN DOWN"];
}; };
} else { } else {

View File

@@ -16,7 +16,7 @@ _rawfood = _itemorignal in meatraw;
_cookedfood = _itemorignal in meatcooked; _cookedfood = _itemorignal in meatcooked;
_hasoutput = _itemorignal in food_with_output; _hasoutput = _itemorignal in food_with_output;
_badfood = _item in badfood; _badfood = _itemorignal in badfood;
_config = configFile >> "CfgMagazines" >> _itemorignal; _config = configFile >> "CfgMagazines" >> _itemorignal;
_text = getText (_config >> "displayName"); _text = getText (_config >> "displayName");
@@ -33,8 +33,6 @@ _sfx = "eat";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak; [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies; [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
if (dayz_lastMeal < 3600) then { if (dayz_lastMeal < 3600) then {
if (_itemorignal == "FoodSteakCooked") then { if (_itemorignal == "FoodSteakCooked") then {
//_regen = _regen * (10 - (10 max ((time - _Cookedtime) / 3600))); //_regen = _regen * (10 - (10 max ((time - _Cookedtime) / 3600)));
@@ -60,7 +58,7 @@ if ( _rawfood and (random 15 < 1)) then {
player setVariable["USEC_infected",true,true]; player setVariable["USEC_infected",true,true];
}; };
if ( _badfood and (random 7 < 1)) then { if ( _badfood and (random 2 < 1)) then {
r_player_infected = true; r_player_infected = true;
player setVariable["USEC_infected",true,true]; player setVariable["USEC_infected",true,true];
}; };

View File

@@ -1,6 +1,6 @@
private ["_item","_ent","_cnt","_index","_wound","_damage","_rnd","_move"]; private ["_target","_ent","_cnt","_index","_wound","_damage","_rnd","_move"];
_item = _this select 3; _target = _this select 3;
_ent = _item; _ent = _target;
// remove menu // remove menu
player removeAction s_player_pzombiesattack; player removeAction s_player_pzombiesattack;
@@ -10,24 +10,24 @@ _rnd = round(random 9) + 1;
_move = "ZombieStandingAttack" + str(_rnd); _move = "ZombieStandingAttack" + str(_rnd);
player playMoveNow _move; player playMoveNow _move;
sleep 0.25;
_isZombie = _ent isKindOf "zZombie_base"; _isZombie = _ent isKindOf "zZombie_base";
// TODO add distance check and maybe los if(player distance _target < 5) then {
if (_ent isKindOf "Animal" or _isZombie) then {
_ent setDamage 1;
} else {
//["usecBreakLegs",[_target,player]] call broadcastRpcCallAll;
usecBreakLegs = [_target,player];
publicVariable "usecBreakLegs";
};
[player,"hit",0,false] call dayz_zombieSpeak;
if (_ent isKindOf "Animal" or _isZombie) then {
_ent setDamage 1;
} else {
//["usecBreakLegs",[_item,player]] call broadcastRpcCallAll;
usecBreakLegs = [_item,player];
publicVariable "usecBreakLegs";
}; };
[player,"hit",0,false] call dayz_zombieSpeak;
player switchmove "";
sleep 1; sleep 1;
player switchmove "";
s_player_pzombiesattack = -1; s_player_pzombiesattack = -1;

View File

@@ -1,4 +1,8 @@
private["_vehicle","_part","_hitpoint","_type","_selection","_array"]; private["_vehicle","_part","_hitpoint","_type","_selection","_array"];
if(TradeInprogress) exitWith { cutText ["Repair already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_id = _this select 2; _id = _this select 2;
_array = _this select 3; _array = _this select 3;
_vehicle = _array select 0; _vehicle = _array select 0;
@@ -6,8 +10,6 @@ _part = _array select 1;
_hitpoint = _array select 2; _hitpoint = _array select 2;
_type = typeOf _vehicle; _type = typeOf _vehicle;
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not repair while someone is in the vehicle", "PLAIN DOWN"]};
// //
_hasToolbox = "ItemToolbox" in items player; _hasToolbox = "ItemToolbox" in items player;
_section = _part in magazines player; _section = _part in magazines player;
@@ -20,42 +22,69 @@ s_player_repair_crtl = 1;
if (_section and _hasToolbox) then { if (_section and _hasToolbox) then {
_damage = [_vehicle,_hitpoint] call object_getHit; player playActionNow "Medic";
_vehicle removeAction _id;
//dont waste loot on undamaged parts _dis=20;
if (_damage > 0) then { _sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
player removeMagazine _part; r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
//disableSerialization; while {r_doLoop} do {
//call dayz_forceSave; _animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
//Fix the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
//["dayzSetFix",[_vehicle,_selection,0],_vehicle] call broadcastRpcCallIfLocal;
dayzSetFix = [_vehicle,_selection,0]; if (_finished) then {
publicVariable "dayzSetFix";
if (local _vehicle) then { _damage = [_vehicle,_hitpoint] call object_getHit;
dayzSetFix call object_setFixServer; _vehicle removeAction _id;
//dont waste loot on undamaged parts
if (_damage > 0) then {
player removeMagazine _part;
//Fix the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
dayzSetFix = [_vehicle,_selection,0];
publicVariable "dayzSetFix";
if (local _vehicle) then {
dayzSetFix call object_setFixServer;
};
_vehicle setvelocity [0,0,1];
//Success!
cutText [format["You have successfully attached %1 to the %2",_namePart,_nameType], "PLAIN DOWN"];
}; };
player playActionNow "Medic"; } else {
sleep 1; r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
_dis=20; player playActionNow "stop";
_sfx = "repair"; cutText ["Canceled Repair.", "PLAIN DOWN"];
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
_vehicle setvelocity [0,0,1];
//Success!
cutText [format["You have successfully attached %1 to the %2",_namePart,_nameType], "PLAIN DOWN"];
}; };
} else { } else {
@@ -87,3 +116,5 @@ if (_allFixed) then {
}; };
s_player_repair_crtl = -1; s_player_repair_crtl = -1;
TradeInprogress = false;

View File

@@ -1,6 +1,7 @@
private["_vehicle","_part","_hitpoint","_type","_selection","_array"]; private["_vehicle","_part","_hitpoint","_type","_selection","_array"];
//disableSerialization; if(TradeInprogress) exitWith { cutText ["Salvage already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_id = _this select 2; _id = _this select 2;
_array = _this select 3; _array = _this select 3;
@@ -9,9 +10,6 @@ _part = _array select 1;
_hitpoint = _array select 2; _hitpoint = _array select 2;
_type = typeOf _vehicle; _type = typeOf _vehicle;
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not salvage while someone is in the vehicle", "PLAIN DOWN"]};
_isOK = false; _isOK = false;
_brokenPart = false; _brokenPart = false;
@@ -27,71 +25,101 @@ s_player_repair_crtl = 1;
if (_hasToolbox) then { if (_hasToolbox) then {
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
null = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_damage = [_vehicle,_hitpoint] call object_getHit; r_interrupt = false;
// _vehicle removeAction _id; _animState = animationState player;
r_doLoop = true;
//dont allow removal of damaged parts _started = false;
if (_damage < 1) then { _finished = false;
_findPercent = (1 - _damage) * 10;
if(ceil (random _findPercent) == 1) then {
_isOK = true;
_brokenPart = true;
} else {
_isOK = [player,_part] call BIS_fnc_invAdd;
_brokenPart = false;
//call dayz_forceSave;
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;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (_isOK) then { if (_finished) then {
player playActionNow "Medic"; _damage = [_vehicle,_hitpoint] call object_getHit;
// _vehicle removeAction _id;
//break the part //dont allow removal of damaged parts
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name"); if (_damage < 1) then {
//vehicle is owned by whoever is in it, so we have to have each client try and fix it _findPercent = (1 - _damage) * 10;
//["dayzSetFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal; if(ceil (random _findPercent) == 1) then {
_isOK = true;
dayzSetFix = [_vehicle,_selection,1]; _brokenPart = true;
publicVariable "dayzSetFix";
if (local _vehicle) then {
dayzSetFix call object_setFixServer;
};
sleep 1;
[player,"repair",0,false] call dayz_zombieSpeak;
null = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
_vehicle setvelocity [0,0,1];
if(_brokenPart) then {
//Failed!
cutText [format["You have destroyed %1 while attempting to remove from %2",_namePart,_nameType], "PLAIN DOWN"];
} else { } else {
//Success! _isOK = [player,_part] call BIS_fnc_invAdd;
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"]; _brokenPart = false;
};
if (_isOK) then {
//break the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
//["dayzSetFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal;
dayzSetFix = [_vehicle,_selection,1];
publicVariable "dayzSetFix";
if (local _vehicle) then {
dayzSetFix call object_setFixServer;
};
_vehicle setvelocity [0,0,1];
if(_brokenPart) then {
//Failed!
cutText [format["You have destroyed %1 while attempting to remove from %2",_namePart,_nameType], "PLAIN DOWN"];
} else {
//Success!
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
};
} else {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
}; };
} else {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
}; };
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled Salvage.", "PLAIN DOWN"];
}; };
} else { } else {
cutText [format["You need %1 to remove this part.",_namePart], "PLAIN DOWN"]; cutText [format["You need %1 to remove this part.",_namePart], "PLAIN DOWN"];
}; };
dayz_myCursorTarget = objNull; dayz_myCursorTarget = objNull;
s_player_repair_crtl = -1; s_player_repair_crtl = -1;
TradeInprogress = false;

View File

@@ -61,7 +61,7 @@ if (!_isOk) then {
//["dayzPublishObj",[dayz_characterID,_tent,[_dir,_location],"TentStorage"]] call callRpcProcedure; //["dayzPublishObj",[dayz_characterID,_tent,[_dir,_location],"TentStorage"]] call callRpcProcedure;
dayzPublishObj = [dayz_characterID,_tent,[_dir,_location],"TentStorage"]; dayzPublishObj = [dayz_characterID,_tent,[_dir,_location],"TentStorage"];
publicVariable "dayzPublishObj"; publicVariableServer "dayzPublishObj";
cutText [localize "str_success_tent_pitch", "PLAIN DOWN"]; cutText [localize "str_success_tent_pitch", "PLAIN DOWN"];
} else { } else {

View File

@@ -15,154 +15,102 @@ _textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6; _textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7; _traderID = (_this select 3) select 7;
_removed = 0;
_bos = 0; _bos = 0;
_bulkqty = 0;
if(_buy_o_sell == "sell") then { if(_buy_o_sell == "sell") then {
// SELL ONLY check if item is bulk
_bulkItem = "bulk_" + _part_in;
_bulkqty = {_x == _bulkItem} count magazines player;
diag_log format["DEBUG bulk: %1", _bulkItem];
_bos = 1; _bos = 1;
}; };
if (_bulkqty >= 1) then { // Get total parts in
_qty = {_x == _part_in} count magazines player;
// Find number of possible trades
_total_trades = floor(_qty / _qty_in);
// TODO: optimize for one db call only // perform number of total trades
for "_x" from 1 to _total_trades do {
_part_in = "bulk_" + _part_in; cutText ["Starting trade, stand still to complete.", "PLAIN DOWN"];
player removeMagazine _part_in;
//disableSerialization; player playActionNow "Medic";
//call dayz_forceSave;
// diag_log format["DEBUG remove magazine %1", _part_in]; _dis=20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
// increment trader for each r_interrupt = false;
for "_x" from 1 to 12 do { _animState = animationState player;
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure; r_doLoop = true;
dayzTradeObject = [_activatingPlayer,_traderID,_bos]; _started = false;
publicVariableServer "dayzTradeObject"; _finished = false;
while {r_doLoop} do {
waitUntil {!isNil "dayzTradeResult"}; _animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if(dayzTradeResult == "PASS") then { if (_isMedic) then {
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult]; _started = true;
}; };
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (!_finished) exitWith {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
}; };
if (_finished) then {
_qty = {_x == _part_in} count magazines player;
if (_qty >= _qty_in) then {
_qty_out = _qty_out * 12; _removed = _removed + ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
if (_removed == _qty_in) then {
// gold = 36 copper // Continue with trade.
// gold = 6 silver dayzTradeObject = [_activatingPlayer,_traderID,_bos];
// publicVariableServer "dayzTradeObject";
if (_part_out == "ItemSilverBar" and _qty_out >= 30) then { waitUntil {!isNil "dayzTradeResult"};
if(dayzTradeResult == "PASS") then {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
// find number of gold cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
_gold_out = _qty_out / 30;
// whole number of gold bars } else {
_gold_qty_out = floor _gold_out; cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
_part_out = "ItemGoldBar";
for "_x" from 1 to _gold_qty_out do {
player addMagazine _part_out;
};
// Find remainder
_partial_qty_out = (_gold_out - _gold_qty_out) * 30;
// whole number of silver bars
_silver_qty_out = floor _partial_qty_out;
_part_out = "ItemSilverBar";
for "_x" from 1 to _silver_qty_out do {
player addMagazine _part_out;
};
} else {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
};
//disableSerialization;
//call dayz_forceSave;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
dayzTradeResult = nil;
} else {
_qty = {_x == _part_in} count magazines player;
if (_qty >= _qty_in) then {
if(_bos == 0) then {
_qty = 1;
};
// trade all items
for "_x" from 1 to _qty do {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
waitUntil {!isNil "dayzTradeResult"};
if(dayzTradeResult == "PASS") then {
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
}; };
for "_x" from 1 to _qty_out do { dayzTradeResult = nil;
player addMagazine _part_out;
};
//disableSerialization;
//call dayz_forceSave;
// [player,"repair",0,false] call dayz_zombieSpeak;
cutText [format[("Traded %1 %2 for %3 %4"),(_qty_in*_qty),_textPartIn,(_qty_out*_qty),_textPartOut], "PLAIN DOWN"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else { } else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
// Return items from botched trade.
// TODO: this may never happen if so remove
for "_x" from 1 to _removed do {
player addMagazine _part_in;
};
}; };
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
}; };
dayzTradeResult = nil;
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
}; };
}; };

View File

@@ -956,7 +956,7 @@ class Citizen1; // External class reference
mapsize = 2; mapsize = 2;
model = "\ca\weapons_e\AmmoBoxes\backpack_tk_alice.p3d"; model = "\ca\weapons_e\AmmoBoxes\backpack_tk_alice.p3d";
transportMaxWeapons = 2; transportMaxWeapons = 2;
transportMaxMagazines = 0; transportMaxMagazines = 16;
}; };
class DZ_TK_Assault_Pack_EP1 : Bag_Base_BAF class DZ_TK_Assault_Pack_EP1 : Bag_Base_BAF
@@ -968,7 +968,7 @@ class Citizen1; // External class reference
icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa"; icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa";
model = "\ca\weapons_e\AmmoBoxes\backpack_civil_assault.p3d"; model = "\ca\weapons_e\AmmoBoxes\backpack_civil_assault.p3d";
transportMaxWeapons = 2; transportMaxWeapons = 2;
transportMaxMagazines = 0; transportMaxMagazines = 16;
}; };
class DZ_British_ACU : Bag_Base_BAF class DZ_British_ACU : Bag_Base_BAF

View File

@@ -32,7 +32,7 @@ if (_isPlayer) then {
dayz_canDisconnect = false; dayz_canDisconnect = false;
//["dayzDiscoAdd",getPlayerUID player] call callRpcProcedure; //["dayzDiscoAdd",getPlayerUID player] call callRpcProcedure;
dayzDiscoAdd = getPlayerUID player; dayzDiscoAdd = getPlayerUID player;
publicVariable "dayzDiscoAdd"; publicVariableServer "dayzDiscoAdd";
dayz_damageCounter = time; dayz_damageCounter = time;

View File

@@ -63,6 +63,21 @@ if(_isPZombie) then {
if (s_player_pzombiesattack < 0) then { if (s_player_pzombiesattack < 0) then {
s_player_pzombiesattack = player addAction ["Attack", "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf",cursorTarget, 6, true, false, "",""]; s_player_pzombiesattack = player addAction ["Attack", "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf",cursorTarget, 6, true, false, "",""];
}; };
_isAnimal = cursorTarget isKindOf "Animal";
_isZombie = cursorTarget isKindOf "zZombie_base";
_isHarvested = cursorTarget getVariable["meatHarvested",false];
_isMan = cursorTarget isKindOf "Man";
// Pzombie Gut human corpse or animal
if (!alive cursorTarget and (_isAnimal or _isMan) and !_isZombie and !_isHarvested and _canDo) then {
if (s_player_pzombiesfeed < 0) then {
s_player_pzombiesfeed = player addAction ["Feed", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""];
};
} else {
player removeAction s_player_pzombiesfeed;
s_player_pzombiesfeed = -1;
};
}; };
@@ -180,31 +195,20 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
s_player_fillfuel = -1; s_player_fillfuel = -1;
}; };
if(_isPZombie) then { // Human Gut animal or zombie
// Pzombie Gut human corpse or animal if (!alive cursorTarget and (_isAnimal or _isZombie) and _hasKnife and !_isHarvested and _canDo) then {
if (!alive cursorTarget and (_isAnimal or _isMan) and !_isZombie and !_isHarvested and _canDo) then { if (s_player_butcher < 0) then {
if (s_player_butcher < 0) then { if(_isZombie) then {
s_player_butcher = player addAction ["Feed", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""]; s_player_butcher = player addAction ["Gut Zombie", "\z\addons\dayz_code\actions\gather_zparts.sqf",cursorTarget, 3, true, true, "", ""];
} else {
s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",cursorTarget, 3, true, true, "", ""];
}; };
} else {
player removeAction s_player_butcher;
s_player_butcher = -1;
}; };
} else { } else {
// Human Gut animal or zombie player removeAction s_player_butcher;
if (!alive cursorTarget and (_isAnimal or _isZombie) and _hasKnife and !_isHarvested and _canDo) then { s_player_butcher = -1;
if (s_player_butcher < 0) then {
if(_isZombie) then {
s_player_butcher = player addAction ["Gut Zombie", "\z\addons\dayz_code\actions\gather_zparts.sqf",cursorTarget, 3, true, true, "", ""];
} else {
s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",cursorTarget, 3, true, true, "", ""];
};
};
} else {
player removeAction s_player_butcher;
s_player_butcher = -1;
};
}; };
//Fireplace Actions check //Fireplace Actions check
if (inflamed cursorTarget and _hasRawMeat and _canDo) then { if (inflamed cursorTarget and _hasRawMeat and _canDo) then {
if (s_player_cook < 0) then { if (s_player_cook < 0) then {

View File

@@ -13,14 +13,14 @@ if (_selection != "" and local _unit) then {
[_unit,"repair"] call server_updateObject [_unit,"repair"] call server_updateObject
} else { } else {
dayzUpdateVehicle = [_unit,"repair"]; dayzUpdateVehicle = [_unit,"repair"];
publicVariable "dayzUpdateVehicle"; publicVariableServer "dayzUpdateVehicle";
}; };
} else { } else {
if (isServer) then { if (isServer) then {
[_unit,"damage"] call server_updateObject [_unit,"damage"] call server_updateObject
} else { } else {
dayzUpdateVehicle = [_unit,"damage"]; dayzUpdateVehicle = [_unit,"damage"];
publicVariable "dayzUpdateVehicle"; publicVariableServer "dayzUpdateVehicle";
}; };
}; };
}; };

View File

@@ -14,7 +14,7 @@ if ((_selection != "") and local _unit) then {
if (_damage >= 1) then { if (_damage >= 1) then {
//["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure; //["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
dayzUpdateVehicle = [_unit,"damage"]; dayzUpdateVehicle = [_unit,"damage"];
publicVariable "dayzUpdateVehicle"; publicVariableServer "dayzUpdateVehicle";
}; };
} else { } else {

View File

@@ -3,7 +3,7 @@ _objects = nearestObjects [getPosATL player, ["Car", "Helicopter", "Motorcycle",
{ {
//["dayzUpdateVehicle",[_x,"gear"]] call callRpcProcedure; //["dayzUpdateVehicle",[_x,"gear"]] call callRpcProcedure;
dayzUpdateVehicle = [_x,"gear"]; dayzUpdateVehicle = [_x,"gear"];
publicVariable "dayzUpdateVehicle"; publicVariableServer "dayzUpdateVehicle";
} foreach _objects; } foreach _objects;

View File

@@ -41,7 +41,7 @@ if(_ownerID == dayz_characterID) then {
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure; //["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
dayzDeleteObj = [_objectID,_objectUID]; dayzDeleteObj = [_objectID,_objectUID];
publicVariable "dayzDeleteObj"; publicVariableServer "dayzDeleteObj";
if (isServer) then { if (isServer) then {
dayzDeleteObj call server_deleteObj; dayzDeleteObj call server_deleteObj;
}; };

View File

@@ -28,7 +28,7 @@ if (_dam < 1 ) then {
[_unit, "damage"] call server_updateObject; [_unit, "damage"] call server_updateObject;
} else { } else {
dayzUpdateVehicle = [_unit,"damage"]; dayzUpdateVehicle = [_unit,"damage"];
publicVariable "dayzUpdateVehicle"; publicVariableServer "dayzUpdateVehicle";
}; };
}; };
}; };

View File

@@ -14,7 +14,7 @@ if (isServer) then {
[_unit, "killed"] call server_updateObject; [_unit, "killed"] call server_updateObject;
} else { } else {
dayzUpdateVehicle = [_unit, "killed"]; dayzUpdateVehicle = [_unit, "killed"];
publicVariable "dayzUpdateVehicle"; publicVariableServer "dayzUpdateVehicle";
}; };
_unit removeAllEventHandlers "HandleDamage"; _unit removeAllEventHandlers "HandleDamage";

View File

@@ -224,6 +224,7 @@ dayz_resetSelfActions = {
s_player_grabflare = -1; s_player_grabflare = -1;
s_player_callzombies = -1; s_player_callzombies = -1;
s_player_pzombiesattack = -1; s_player_pzombiesattack = -1;
s_player_pzombiesfeed = -1;
s_player_removeflare = -1; s_player_removeflare = -1;
s_player_painkiller = -1; s_player_painkiller = -1;
s_player_studybody = -1; s_player_studybody = -1;

View File

@@ -1,40 +1,71 @@
// medBreakLegs.sqf // medBreakLegs.sqf
private["_array","_unit","_medic","_display","_control","_hitLegs","_hitArms"]; private["_array","_unit","_attacker","_display","_control","_hitLegs","_hitArms"];
disableserialization; disableserialization;
_array = _this; //_this select 0; _array = _this; //_this select 0;
_unit = _array select 0; _unit = _array select 0;
_medic = _array select 1; _attacker = _array select 1;
if (local _unit && _unit == player) then { if (_unit == player && player distance _attacker < 5) then {
_unit setVariable["startcombattimer", 1, false]; player setVariable["startcombattimer", 1, false];
// Make bleed // Make bleed
if (random 2 < 1) then { if (random 2 < 1) then {
// Find hit
_cnt = count (DAYZ_woundHit_ok select 1);
_index = floor (random _cnt);
_index = (DAYZ_woundHit_ok select 1) select _index;
_hit = (DAYZ_woundHit_ok select 0) select _index;
_damage = 0.1 + random (1.2);
//Record Damage to Minor parts (legs, arms)
if (_hit in USEC_MinorWounds) then {
[_unit,_hit,_damage] call object_processHit;
};
player setVariable["medForceUpdate",true,true];
1 call fnc_usec_bulletHit;
_wound = _hit call fnc_usec_damageGetWound;
//Create Wound
_unit setVariable[_wound,true,true];
[_unit,_wound,_hit] spawn fnc_usec_damageBleed;
usecBleed = [_unit,_wound,_hit];
publicVariable "usecBleed";
//Set Injured if not already
_isInjured = _unit getVariable["USEC_injured",false];
if (!_isInjured) then {
_unit setVariable["USEC_injured",true,true];
dayz_sourceBleeding = _attacker;
};
//Set ability to give blood
_lowBlood = _unit getVariable["USEC_lowBlood",false];
if (!_lowBlood) then {
_unit setVariable["USEC_lowBlood",true,true];
};
r_player_injured = true; r_player_injured = true;
player setVariable ["USEC_injured",true,true];
//Ensure Control is visible for bleeding // reduce blood
_display = uiNamespace getVariable 'DAYZ_GUI_display'; r_player_blood = r_player_blood - 50;
_control = _display displayCtrl 1300;
_control ctrlShow true; // Make player infected
if (random 5 < 1) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
}; };
// Make player infected [_unit,"hit",2,false] call dayz_zombieSpeak;
if (random 5 < 1) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
// Break legs
if (random 25 < 1) then {
// break legs
};
// Knock out
if (random 100 < 1) then {
// perform knockout
};
player setVariable["medForceUpdate",true];
}; };

View File

@@ -18,7 +18,7 @@ item13[] = {"no_PlayerID",4,218,50.000000,150.000000,150.000000,200.000000,2.000
item14[] = {"ERROR__No_Player",2,250,175.000000,150.000000,275.000000,200.000000,0.000000,"ERROR:" \n "No PlayerID"}; item14[] = {"ERROR__No_Player",2,250,175.000000,150.000000,275.000000,200.000000,0.000000,"ERROR:" \n "No PlayerID"};
item15[] = {"Request",2,250,-75.000000,250.000000,25.000000,300.000000,0.000000,"Request"}; item15[] = {"Request",2,250,-75.000000,250.000000,25.000000,300.000000,0.000000,"Request"};
item16[] = {"Response",4,218,-175.000000,300.000000,-75.000000,350.000000,0.000000,"Response"}; item16[] = {"Response",4,218,-175.000000,300.000000,-75.000000,350.000000,0.000000,"Response"};
item17[] = {"Parse_Login",2,4346,-75.000000,350.000000,25.000000,400.000000,0.000000,"Parse Login"}; item17[] = {"Parse_Login",2,250,-75.000000,350.000000,25.000000,400.000000,0.000000,"Parse Login"};
item18[] = {"Hive_Bad",4,218,50.000000,350.000000,150.000000,400.000000,10.000000,"Hive" \n "Bad"}; item18[] = {"Hive_Bad",4,218,50.000000,350.000000,150.000000,400.000000,10.000000,"Hive" \n "Bad"};
item19[] = {"ERROR__Wrong_HIVE",2,250,175.000000,350.000000,275.000000,400.000000,0.000000,"ERROR:" \n "Wrong HIVE" \n "Version"}; item19[] = {"ERROR__Wrong_HIVE",2,250,175.000000,350.000000,275.000000,400.000000,0.000000,"ERROR:" \n "Wrong HIVE" \n "Version"};
item20[] = {"Hive_Ok",4,218,-175.000000,400.000000,-75.000000,450.000000,0.000000,"Hive" \n "Ok"}; item20[] = {"Hive_Ok",4,218,-175.000000,400.000000,-75.000000,450.000000,0.000000,"Hive" \n "Ok"};
@@ -45,7 +45,7 @@ item40[] = {"Too_Long",4,218,300.000000,550.000000,400.000000,600.000000,0.00000
item41[] = {"Too_Long",4,218,300.000000,650.000000,400.000000,700.000000,0.000000,"Too" \n "Long"}; item41[] = {"Too_Long",4,218,300.000000,650.000000,400.000000,700.000000,0.000000,"Too" \n "Long"};
item42[] = {"Enable_Sim",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Enable Sim"}; item42[] = {"Enable_Sim",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Enable Sim"};
item43[] = {"Initialized",4,218,-175.000000,-150.000000,-75.000000,-100.000000,0.000000,"Initialized"}; item43[] = {"Initialized",4,218,-175.000000,-150.000000,-75.000000,-100.000000,0.000000,"Initialized"};
item44[] = {"New_Character",4,218,-425.000000,275.000000,-325.000000,325.000000,5.000000,"New" \n "Character"}; item44[] = {"New_Character",4,218,-425.000000,275.000000,-325.000000,325.000000,6.000000,"New" \n "Character"};
item45[] = {"Gender_Selection",2,250,-500.000000,350.000000,-400.000000,400.000000,0.000000,"Gender Selection" \n "Dialog"}; item45[] = {"Gender_Selection",2,250,-500.000000,350.000000,-400.000000,400.000000,0.000000,"Gender Selection" \n "Dialog"};
item46[] = {"Selected",4,218,-450.000000,450.000000,-350.000000,500.000000,0.000000,"Selected"}; item46[] = {"Selected",4,218,-450.000000,450.000000,-350.000000,500.000000,0.000000,"Selected"};
item47[] = {"Process",2,250,-300.000000,475.000000,-200.000000,525.000000,0.000000,"Process"}; item47[] = {"Process",2,250,-300.000000,475.000000,-200.000000,525.000000,0.000000,"Process"};
@@ -119,8 +119,8 @@ link59[] = {51,52};
link60[] = {52,29}; link60[] = {52,29};
link61[] = {53,54}; link61[] = {53,54};
link62[] = {54,20}; link62[] = {54,20};
globals[] = {25.000000,1,0,0,0,640,480,1,85,6316128,1,-442.430725,330.314087,709.154297,0.804942,960,880,1}; globals[] = {25.000000,1,0,0,0,640,480,1,85,6316128,1,-442.430725,330.314087,740.948608,133.929596,1062,880,1};
window[] = {2,-1,-1,-1,-1,872,2033,3004,112,3,978}; window[] = {2,-1,-1,-1,-1,760,137,1108,0,3,1080};
*//*%FSM</HEAD>*/ *//*%FSM</HEAD>*/
class FSM class FSM
{ {
@@ -431,7 +431,7 @@ class FSM
"//[""dayzLogin"",[_playerUID,player]] call callRpcProcedure;" \n "//[""dayzLogin"",[_playerUID,player]] call callRpcProcedure;" \n
"" \n "" \n
"dayzLogin = [_playerUID,player];" \n "dayzLogin = [_playerUID,player];" \n
"publicVariable ""dayzLogin"";" \n "publicVariableServer ""dayzLogin"";" \n
"" \n "" \n
"dayzPlayerLogin = [];" \n "dayzPlayerLogin = [];" \n
""/*%FSM</STATEINIT""">*/; ""/*%FSM</STATEINIT""">*/;
@@ -515,7 +515,7 @@ class FSM
/*%FSM<LINK "New_Character">*/ /*%FSM<LINK "New_Character">*/
class New_Character class New_Character
{ {
priority = 5.000000; priority = 6.000000;
to="Gender_Selection"; to="Gender_Selection";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/; precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_isNew && _isInfected == 0"/*%FSM</CONDITION""">*/; condition=/*%FSM<CONDITION""">*/"_isNew && _isInfected == 0"/*%FSM</CONDITION""">*/;
@@ -657,7 +657,7 @@ class FSM
"//[""dayzLogin2"",[_charID,player,_playerUID]] call callRpcProcedure;" \n "//[""dayzLogin2"",[_charID,player,_playerUID]] call callRpcProcedure;" \n
"" \n "" \n
"dayzLogin2 = [_charID,player,_playerUID];" \n "dayzLogin2 = [_charID,player,_playerUID];" \n
"publicVariable ""dayzLogin2"";" \n "publicVariableServer ""dayzLogin2"";" \n
"" \n "" \n
"dayz_loadScreenMsg = ""Requesting Character data from server"";" \n "dayz_loadScreenMsg = ""Requesting Character data from server"";" \n
"progressLoadingScreen 0.8;" \n "progressLoadingScreen 0.8;" \n
@@ -1118,7 +1118,7 @@ class FSM
" sleep 2;" \n " sleep 2;" \n
" };" \n " };" \n
"};" \n "};" \n
"" \n "" \n
"dayz_Totalzedscheck = [] spawn {" \n "dayz_Totalzedscheck = [] spawn {" \n
" while {true} do {" \n " while {true} do {" \n
" dayz_maxCurrentZeds = {alive _x} count entities ""zZombie_Base"";" \n " dayz_maxCurrentZeds = {alive _x} count entities ""zZombie_Base"";" \n
@@ -1165,7 +1165,7 @@ class FSM
"//[""dayzLoginRecord"",[_playerUID,_charID,0]] call callRpcProcedure;" \n "//[""dayzLoginRecord"",[_playerUID,_charID,0]] call callRpcProcedure;" \n
"" \n "" \n
"dayzLoginRecord = [_playerUID,_charID,0];" \n "dayzLoginRecord = [_playerUID,_charID,0];" \n
"publicVariable ""dayzLoginRecord"";" \n "publicVariableServer ""dayzLoginRecord"";" \n
""/*%FSM</STATEINIT""">*/; ""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/; precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links class Links

View File

@@ -238,7 +238,7 @@ while {true} do {
dayz_canDisconnect = true; dayz_canDisconnect = true;
//["dayzDiscoRem",getPlayerUID player] call callRpcProcedure; //["dayzDiscoRem",getPlayerUID player] call callRpcProcedure;
dayzDiscoRem = getPlayerUID player; dayzDiscoRem = getPlayerUID player;
publicVariable "dayzDiscoRem"; publicVariableServer "dayzDiscoRem";
//Ensure Control is hidden //Ensure Control is hidden
_display = uiNamespace getVariable 'DAYZ_GUI_display'; _display = uiNamespace getVariable 'DAYZ_GUI_display';