0.69 + 1.7.5.M1D15

This commit is contained in:
vbawol
2013-01-18 12:25:49 -06:00
parent 662d62d781
commit 4cab61bf63
81 changed files with 1061 additions and 532 deletions

197
dayz_code/CfgMagazines.hpp Normal file
View File

@@ -0,0 +1,197 @@
class CfgMagazines {
class CA_Magazine; // External class reference
class ItemTent : CA_Magazine {
scope = public;
count = 1;
type = (256 * 3);
displayName = $STR_EQUIP_NAME_20;
model = "\dayz_equip\models\tentbag_gear.p3d";
picture = "\dayz_equip\textures\equip_tentbag_ca.paa";
descriptionShort = $STR_EQUIP_DESC_20;
class ItemActions {
class Pitch {
text = $STR_PITCH_TENT;
script = "spawn player_tentPitch;";
};
};
};
class ItemSandbag : CA_Magazine {
scope = public;
count = 1;
type = 256;
displayName = $STR_EQUIP_NAME_21;
model = "\dayz_equip\models\sandbags.p3d";
picture = "\dayz_equip\textures\equip_sandbag_ca.paa";
descriptionShort = $STR_EQUIP_DESC_21;
class ItemActions {
class Build {
text = "Build me";
script = "spawn player_build;";
require = "ItemEtool";
create = "Sandbag1_DZ";
};
};
};
class ItemTankTrap : CA_Magazine {
scope = public;
count = 1;
type = 256;
displayName = $STR_EQUIP_NAME_22;
model = "\dayz_equip\models\tank_trap_kit.p3d";
picture = "\dayz_equip\textures\equip_tanktrap_kit_CA.paa";
descriptionShort = $STR_EQUIP_DESC_22;
class ItemActions {
class Build {
text = $STR_ACTIONS_BUILD;
script = "spawn player_build;";
require = "ItemToolbox";
create = "Hedgehog_DZ";
};
};
};
class TrapBear : CA_Magazine {
scope = public;
count = 1;
type = 256;
displayName = "Bear Trap";
model = "\dayz_equip\models\bear_trap_gear.p3d";
picture = "\dayz_equip\textures\equip_bear_trap_ca.paa";
descriptionShort = "Place to add a bear trap";
class ItemActions {
class Build {
text = "Place Trap";
script = "spawn player_setTrap;";
require = "ItemToolbox";
create = "BearTrap_DZ";
};
};
};
class ItemWire : CA_Magazine {
scope = public;
count = 1;
type = 256;
displayName = $STR_EQUIP_NAME_23;
model = "\dayz_equip\models\Fence_wire_kit.p3d";
picture = "\dayz_equip\textures\equip_fencewire_kit_CA.paa";
descriptionShort = $STR_EQUIP_DESC_23;
class ItemActions {
class Build {
text = $STR_ACTIONS_BUILD;
script = "spawn player_build;";
require = "ItemToolbox";
create = "Wire_cat1";
};
};
};
class FoodmuttonRaw : CA_Magazine {
scope = public;
count = 1;
type = 256;
displayName = $STR_FOOD_EQIP_CODE_NAME_1;
model = "\z\addons\dayz_communityassets\models\boar_raw.p3d";
picture = "\z\addons\dayz_communityassets\pictures\icon_boar_steak_raw_ca.paa";
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_1;
};
class FoodchickenRaw : CA_Magazine {
scope = public;
count = 1;
type = 256;
displayName = $STR_FOOD_EQIP_CODE_NAME_2;
model = "\z\addons\dayz_communityassets\models\chicken_raw.p3d";
picture = "\z\addons\dayz_communityassets\pictures\icon_chicken_raw_ca.paa";
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_2;
};
class FoodrabbitRaw : CA_Magazine {
scope = public;
count = 1;
type = 256;
displayName = $STR_FOOD_EQIP_CODE_NAME_3;
model = "\z\addons\dayz_communityassets\models\rabbit_raw.p3d";
picture = "\z\addons\dayz_communityassets\pictures\i_rabbit_raw_co.paa";
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_3;
};
class FoodbaconRaw : CA_Magazine {
scope = public;
count = 1;
type = 256;
displayName = $STR_FOOD_EQIP_CODE_NAME_4;
model = "\z\addons\dayz_communityassets\models\bacon_raw.p3d";
picture = "\z\addons\dayz_communityassets\pictures\i_bacon_raw.paa";
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_4;
};
class DayZ_Code_FoodEdible : CA_Magazine {
isFood = 1;
count = 1;
type = 256;
class ItemActions {
class Eat {
text = $STR_EAT_FOOD;
script = "spawn player_eat;";
};
};
};
class FoodmuttonCooked : DayZ_Code_FoodEdible {
scope = public;
count = 1;
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_1;
model = "\z\addons\dayz_communityassets\models\boar_geo.p3d";
picture = "\z\addons\dayz_communityassets\pictures\icon_boar_steak_cooked_ca.paa";
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_1;
bloodRegen = 200;
};
class FoodchickenCooked : DayZ_Code_FoodEdible {
scope = public;
count = 1;
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_2; //$STR_EQUIP_NAME_25
model = "\z\addons\dayz_communityassets\models\chicken_cooked.p3d";
picture = "\z\addons\dayz_communityassets\pictures\icon_chicken_cooked_ca.paa";
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_2;
bloodRegen = 400;
};
class FoodBaconCooked : DayZ_Code_FoodEdible {
scope = public;
count = 1;
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_4;
model = "\z\addons\dayz_communityassets\models\bacon_cooked.p3d";
picture = "\z\addons\dayz_communityassets\pictures\i_bacon_cooked.paa";
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_4;
bloodRegen = 800;
};
class FoodRabbitCooked : DayZ_Code_FoodEdible {
scope = public;
count = 1;
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_3;
model = "\z\addons\dayz_communityassets\models\rabbit_cooked.p3d";
picture = "\z\addons\dayz_communityassets\pictures\i_rabbit_cooked_co.paa";
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_3;
bloodRegen = 100;
};
class AngelCookies : DayZ_Code_FoodEdible {
scope = public;
count = 1;
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_5;
model = "\z\addons\dayz_communityassets\models\buiscits_box.p3d";
picture = "\z\addons\dayz_communityassets\pictures\i_buiscit_cai_buiscit_ca.paa";
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_5;
bloodRegen = 100;
};
};

43
dayz_code/CfgMarkers.hpp Normal file
View File

@@ -0,0 +1,43 @@
class CfgMarkers
{
class Cricle01 {
name = "Marker description";
icon = "\z\addons\dayz_communityassets\cricle_01_raw.paa";
color[] = {1, 0, 0, 1};
size = 32;
shadow = true;
scope = private;
};
class Cricle02 {
name = "Marker description";
icon = "\z\addons\dayz_communityassets\cricle_02_raw.paa";
color[] = {1, 0, 0, 1};
size = 32;
shadow = true;
scope = private;
};
class Cross01 {
name = "Marker description";
icon = "\z\addons\dayz_communityassets\cross_01_raw.paa";
color[] = {1, 0, 0, 1};
size = 32;
shadow = true;
scope = private;
};
class Cross02 {
name = "Marker description";
icon = "\z\addons\dayz_communityassets\cross_02_raw.paa";
color[] = {1, 0, 0, 1};
size = 32;
shadow = true;
scope = private;
};
class Questionmark {
name = "Marker description";
icon = "\z\addons\dayz_communityassets\questionmark_raw.paa";
color[] = {1, 0, 0, 1};
size = 32;
shadow = true;
scope = private;
};
};

72
dayz_code/CfgWeapons.hpp Normal file
View File

@@ -0,0 +1,72 @@
class CfgWeapons {
class ItemCore;
class ItemMap1: ItemCore {
descriptionshort = "Map";
displayname = "Map";
picture = "\z\addons\dayz_communityassets\icons\gear_picture_map_01_ca.paa";
scope = 2;
simulation = "ItemMap";
};
class ItemMap2: ItemCore {
descriptionshort = "Map";
displayname = "Map";
picture = "\z\addons\dayz_communityassets\icons\gear_picture_map_02_ca.paa";
scope = 2;
simulation = "ItemMap";
};
class ItemMap3: ItemCore {
descriptionshort = "Map";
displayname = "Map";
picture = "\z\addons\dayz_communityassets\icons\gear_picture_map_03_ca.paa";
scope = 2;
simulation = "ItemMap";
};
class ItemMap_Debug: ItemCore {
descriptionshort = "Debug Map - Admin use only";
displayname = "Map";
picture = "\ca\ui\data\gear_picture_map_ca.paa";
scope = 2;
simulation = "ItemMap";
class Library {
libtextdesc = "Debug Map - Admin use only";
};
};
class ItemMatchboxWet : ItemCore {
scope = public;
displayName = $STR_EQUIP_CODE_NAME_3;
model = "\dayz_equip\models\matchbox_gear.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_matchbox_wet_CA.paa";
descriptionShort = $STR_EQUIP_CODE_DESC_3;
};
class ItemMatchboxEmpty : ItemCore {
scope = public;
displayName = "Empty Match Box";
model = "\dayz_equip\models\matchbox_gear.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_matchbox_wet_CA.paa";
descriptionShort = $STR_EQUIP_CODE_DESC_3;
};
class ItemBrokeHatchet : ItemCore {
scope = public;
displayName = $STR_EQUIP_CODE_NAME_41;
model = "\dayz_equip\models\hatchet.p3d";
picture = "\dayz_equip\textures\equip_hatchet_CA.paa";
descriptionShort = $STR_EQUIP_CODE_DESC_41;
class ItemActions {
class Toolbelt {
text = "Remove from Toolbelt";
script = "spawn player_addToolbelt;";
use[] = {"ItemBrokeHatchet"};
output[] = {"MeleeHatchet"};
};
};
};
class ItemKnifeBlunt : ItemCore {
scope = public;
displayName = $STR_EQUIP_CODE_NAME_4;
model = "\dayz_equip\models\knife_gear.p3d";
picture = "\dayz_equip\textures\equip_knife_ca.paa";
descriptionShort = $STR_EQUIP_CODE_DESC_4;
};
};

View File

@@ -33,11 +33,7 @@ player reveal _object;
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariableServer "dayzPublishObj";
if (isServer) then {
dayzPublishObj call server_publishObj;
};
["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
sleep 2;
player allowDamage true;

View File

@@ -10,11 +10,7 @@ _category = (_this select 3) select 1;
diag_log format["DEBUG TRADER OBJ: %1", _trader_id];
dayzTraderMenu = [_activatingPlayer,_trader_id,_category,_action];
publicVariableServer "dayzTraderMenu";
if (isServer) then {
dayzTraderMenu call server_traders;
};
["dayzTraderMenu",[_activatingPlayer,_trader_id,_category,_action]] call callRpcProcedure;
waitUntil {!isNil "dayzTraderMenuResult"};

View File

@@ -1,7 +1,3 @@
private["_object"];
dayzUpdateVehicle = [_this select 3,"all"];
publicVariableServer "dayzUpdateVehicle";
if (isServer) then {
dayzUpdateVehicle call server_updateObject;
};
["dayzUpdateVehicle",[_this select 3,"all"]] call callRpcProcedure;

View File

@@ -1,38 +1,43 @@
private["_hasKnife","_qty","_item","_text","_string","_type","_loop","_meat","_timer"];
private["_item","_hasKnife","_hasKnifeBlunt","_hasHarvested","_qty","_text","_string","_type"];
_item = _this select 3;
_hasKnife = "ItemKnife" in items player;
_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
_type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = -1;
_hasChance = 9 > random 100;
if (_hasKnife and !_hasHarvested) then {
if (_hasKnife) then {
if (_hasChance) then {
player removeWeapon "ItemKnife";
player addWeapon "ItemKnifeBlunt";
cutText [localize "STR_EQUIP_CODE_DESC_4", "PLAIN DOWN"];
};
};
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type
_loop = true;
_isListed = isClass (_config);
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
player playActionNow "Medic";
[player,"gut",0,false] call dayz_zombieSpeak;
_item setVariable["meatHarvested",true,true];
_item setVariable ["timerawmeatHarvested",time,false];
_qty = 1;
_qty = 2;
if (_isListed) then {
_qty = getNumber (_config >> "yield");
};
if (_hasKnifeBlunt) then { _qty = round(_qty / 2); };
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_array = [_item,_qty];
if (local _item) then {
_array spawn local_gutObject;
} else {
dayzGutBody = _array;
publicVariable "dayzGutBody";
};
["dayzGutBody",[_item,_qty]] call callRpcProcedure;
sleep 6;
_string = format[localize "str_success_gutted_animal",_text,_qty];

View File

@@ -1,6 +1,7 @@
private["_hasKnife","_qty","_item","_text","_string","_type","_loop","_meat","_timer"];
_item = _this select 3;
_hasKnife = "ItemKnife" in items player;
_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
_type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
@@ -8,7 +9,7 @@ _config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = -1;
if (_hasKnife and !_hasHarvested) then {
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type
_loop = true;
_isListed = isClass (_config);
@@ -19,20 +20,12 @@ if (_hasKnife and !_hasHarvested) then {
_item setVariable["meatHarvested",true,true];
_qty = 1;
if (_isListed) then {
_qty = getNumber (_config >> "yield");
};
_id = [player,100,true,(getPosATL player)] spawn player_alertZombies;
_array = [_item,_qty];
if (local _item) then {
_array spawn local_gutObjectZ;
} else {
dayzGutBodyZ = _array;
publicVariable "dayzGutBodyZ";
};
["dayzGutBodyZ",[_item,_qty]] call callRpcProcedure;
sleep 6;
_string = format["Successfully Gutted Zombie",_text,_qty];

View File

@@ -3,6 +3,7 @@ _location = player modeltoworld [0,1,0];
_location set [2,0];
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater _location) or dayz_isSwimming;
_bypass = false;
call gear_ui_init;
@@ -11,12 +12,16 @@ if(_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"];};
_item = _this;
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
_require = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "require");
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_hasbuilditem = _this in magazines player;
_hasrequireditem = _require in items player;
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
if (_text == "TrapBear") then { _bypass = true; };
if (_hasrequireditem or _bypass) then {
_dir = getDir player;
player removeMagazine _item;
@@ -33,11 +38,10 @@ player reveal _object;
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariableServer "dayzPublishObj";
if (isServer) then {
dayzPublishObj call server_publishObj;
};
["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
sleep 2;
player allowDamage true;
} else {
cutText [format[localize "str_build_failed_01",_text], "PLAIN DOWN"];
};

View File

@@ -2,14 +2,21 @@ private["_location","_isOk","_dir","_classname"];
private["_item"];
_item = _this;
call gear_ui_init;
_hasChance = 9 > random 100;
if (["forest",dayz_surfaceType] call fnc_inString) then {
if (!_hasChance) then {
_result = [player,"PartWoodPile"] call BIS_fnc_invAdd;
if (_result) then {
cutText [localize "str_player_25", "PLAIN DOWN"];
} else {
cutText [localize "str_player_24", "PLAIN DOWN"];
};
} else {
player removeWeapon "ItemHatchet";
player addWeapon "ItemBrokeHatchet";
cutText [localize "str_player_23", "PLAIN DOWN"];
}
} else {
cutText [localize "str_player_23", "PLAIN DOWN"];
};

View File

@@ -6,11 +6,15 @@ if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not drink while in a vehicle", "PLAIN DOWN"]};
if (dayz_thirst == 0) exitWith {cutText ["I am not thirsty", "PLAIN DOWN"]};
//Force players to wait 3 mins to drink again
if (dayz_lastDrink < 180) exitWith {cutText ["You may not drink, your not thirsty", "PLAIN DOWN"]};
_item = _this;
_hasdrinkitem = _this in magazines player;
_rndInfection = (random 15);
_DrinkInfection = (_rndInfection < 1);
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
_sfx = getText (_config >> "sfx");
@@ -25,7 +29,13 @@ sleep 1;
if (_item == "ItemWaterbottle") then {
player addMagazine "ItemWaterbottleUnfilled";
if (_DrinkInfection) then {
r_player_infected = true;
player setVariable["USEC_infected",true];
};
};
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
/*

View File

@@ -5,17 +5,30 @@ _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animati
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not eat while in a vehicle", "PLAIN DOWN"]};
if (dayz_hunger == 0) exitWith {cutText ["I am not hungry", "PLAIN DOWN"]};
//Force players to wait 3 mins to eat again
if (dayz_lastMeal < 180) exitWith {cutText ["You may not eat, you're already full", "PLAIN DOWN"]};
_item = _this;
_hasfoodmag = _this in magazines player;
_hasfooditem = _this in magazines player;
_rndInfection = (random 15);
_EatInfection = (_rndInfection < 1);
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
_regen = getNumber (_config >> "bloodRegen");
if (!_hasfoodmag) exitWith {cutText [format[(localize "str_player_31"),_text,"consume"] , "PLAIN DOWN"]};
if (!_hasfooditem) exitWith {cutText [format[(localize "str_player_31"),_text,"consume"] , "PLAIN DOWN"]};
if (_EatInfection) then {
if (_item == "FoodSteakCooked" ) then {
r_player_infected = true;
player setVariable["USEC_infected",true];
};
};
//Rawtime = getVarable _item
//_Cookedtime = _item getVariable ["timemeatCooked", time];
player playActionNow "PutDown";
player removeMagazine _item;
@@ -38,11 +51,7 @@ _update = player getVariable["updatePlayer",[false,false,false,false,false]];
_update set [3,true];
player setVariable["updatePlayer",_update,true];
*/
dayzPlayerSave = player;
publicVariableServer "dayzPlayerSave";
if (isServer) then {
dayzPlayerSave call server_updatePlayer;
};
["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
dayz_lastMeal = time;
dayz_hunger = 0;

View File

@@ -6,9 +6,11 @@ if ((_location select 2) < 0) then {
//_location set [2,0];
_isOk = true; //count (_location isFlatEmpty [0.3,0,0,4,0,false,player]) > 0;
_hasWood = "PartWoodPile" in magazines player;
_hasChance = 9 > random 100;
if (_hasWood) then {
if (_isOk) then {
if (!_hasChance) then {
player removeMagazine "PartWoodPile";
_dir = getDir player;
_classname = "Land_Fire_DZ";
@@ -21,6 +23,11 @@ if (_hasWood) then {
_id = _fire spawn player_fireMonitor;
cutText [localize "str_fireplace_01", "PLAIN DOWN"];
} else {
player removeWeapon "ItemMatchbox";
player addWeapon "ItemMatchboxEmpty";
cutText [localize "Your box of matches appear to be empty", "PLAIN DOWN"];
};
} else {
cutText [localize "str_fireplace_02", "PLAIN DOWN"];
};

View File

@@ -5,8 +5,10 @@ _action = _this select 2;
_caller removeAction _action;
_callerID = _caller getVariable "characterID";
_targetID = _target getVariable "characterID";
_callerID = _caller getVariable ["characterID", "0"];
_targetID = _target getVariable ["characterID", "0"];
if (_callerID != 0 && _targetID != 0) then {
_friendlies = _caller getVariable ["friendlies", []];
_friendlies set [count _friendlies, _targetID];
@@ -14,9 +16,10 @@ _caller setVariable ["friendlies", _friendlies, true];
_rfriendlies = _target getVariable ["friendlies", []];
if ((isNull _rfriendlies) or !(_callerID in _rfriendlies)) then {
if ((isNil "_rfriendlies") or !(_callerID in _rfriendlies)) then {
// caller
titleText [format["You have tagged %1 as friendly. Waiting for %1 to accept that.",(name _target)]];
// target
[_caller,_target,"loc",rTITLETEXT,format["%1 wants to tag you as friendly. To accept, tag %1 as friendly.", (name _caller)],"PLAIN DOWN"] call RE;
};
};

View File

@@ -0,0 +1,38 @@
//Remove action menu
player removeAction s_player_stats;
s_player_stats = -1;
//set stats enabled later use
player setVariable ["StatsEnabled",true,false];
//Let Zeds know
_id = [player,4,true,(getPosATL player)] spawn player_alertZombies;
//display gui (temp hint)
hintSilent parseText format ["
<t size='1.20' font='Bitstream' color='#5882FA'>%1</t><br/><br/>
<t size='1.15' font='Bitstream' align='left'>Zombies Killed: </t><t size='1.15' font='Bitstream' align='right'>%2</t><br/>
<t size='1.15' font='Bitstream' align='left'>Headshots: </t><t size='1.15' font='Bitstream' align='right'>%3</t><br/>
<t size='1.15' font='Bitstream' align='left'>Murders: </t><t size='1.15' font='Bitstream' align='right'>%4</t><br/>
<t size='1.15' font='Bitstream' align='left'>Bandits Killed: </t><t size='1.15' font='Bitstream' align='right'>%5</t><br/><br/>
<t size='1.15' font='Bitstream' align='left'>Humanity: </t><t size='1.15' font='Bitstream' align='right'>%6</t><br/><br/>",
(name player),
(player getVariable['zombieKills', 0]),
(player getVariable['headShots', 0]),
(player getVariable['humanKills', 0]),
(player getVariable['banditKills', 0]),
(player getVariable['humanity', 0])
];
/*
player createDiarySubject ["MyDiary","My Diary"];
player createDiaryRecord ["MyDiary",["Stats", "Zombies Killed: <execute expression='player getVariable['zombieKills', 0]'</execute>"]];
player createDiaryRecord ["MyDiary",["Stats", "Headshots: <execute expression='player getVariable['headShots', 0]'</execute>"]];
player createDiaryRecord ["MyDiary",["Stats", "Murders: <execute expression='player getVariable['humanKills', 0]'</execute>"]];
player createDiaryRecord ["MyDiary",["Stats", "Bandits Killed: <execute expression='player getVariable['banditKills', 0]'</execute>"]];
player createDiaryRecord ["MyDiary",["Stats", "Humanity: <execute expression='player getVariable['humanity', 0]'</execute>"]];
*/
//Remove variable
player setVariable ["StatsEnabled",false,false];

View File

@@ -58,11 +58,7 @@ dayz_thirst = 0;
dayz_lastMeal = time;
dayz_hunger = 0;
dayzPlayerSave = player;
publicVariableServer "dayzPlayerSave";
if (isServer) then {
dayzPlayerSave call server_updatePlayer;
};
["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
[player,"eat",0,false] call dayz_zombieSpeak;
@@ -84,9 +80,8 @@ _control = _display displayCtrl 1302;
_control ctrlShow true;
// Remove body
dayzHideBody = _item;
publicVariable "dayzHideBody";
hideBody _item;
["dayzHideBody",_item] call broadcastRpcCallAll;
cutText [format[(localize "str_player_consumed"),_item, "PLAIN DOWN"];

View File

@@ -21,9 +21,9 @@ _id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
dayzSetFuel = [_vehicle,_newFuel];
dayzSetFuel spawn local_sefFuel;
publicVariable "dayzSetFuel";
//apply newFuel to vehicle on every peer
["dayzSetFuel",[_vehicle,_newFuel]] call broadcastRpcCallAll;
cutText [format[localize "str_player_05",_nameType,_canSize], "PLAIN DOWN"];
sleep 1;

View File

@@ -13,10 +13,5 @@ sleep 1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
if (isServer) then {
dayzDeleteObj call local_deleteObj;
};
["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;

View File

@@ -26,11 +26,8 @@ if (_section and _hasToolbox) then {
//Fix the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
dayzSetFix = [_vehicle,_selection,0];
publicVariable "dayzSetFix";
if (local _vehicle) then {
dayzSetFix call object_setFixServer;
};
//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;
player playActionNow "Medic";
sleep 1;
@@ -64,12 +61,5 @@ _allFixed = true;
//update if repaired
if (_allFixed) then {
_vehicle setDamage 0;
dayzUpdateVehicle = [_vehicle,"repair"];
if (isServer) then {
if (allowConnection) then {
dayzUpdateVehicle call server_updateObject;
};
} else {
publicVariable "dayzUpdateVehicle";
};
["dayzUpdateVehicle",[_vehicle,"repair"]] call callRpcProcedure;
};

View File

@@ -10,11 +10,7 @@ _category = (_this select 3) select 1;
diag_log format["DEBUG TRADER OBJ: %1", _trader_id];
dayzTraderMenu = [_activatingPlayer,_trader_id,_category,_action];
publicVariableServer "dayzTraderMenu";
if (isServer) then {
dayzTraderMenu call server_traders;
};
["dayzTraderMenu",[_activatingPlayer,_trader_id,_category,_action]] call callRpcProcedure;
waitUntil {!isNil "dayzTraderMenuResult"};

View File

@@ -57,11 +57,7 @@ if (!_isOk) then {
//player setVariable ["tentUpdate",["Land_A_tent",_dir,_location,[dayz_tentWeapons,dayz_tentMagazines,dayz_tentBackpacks]],true];
dayzPublishObj = [dayz_characterID,_tent,[_dir,_location],"TentStorage"];
publicVariable "dayzPublishObj";
if (isServer) then {
dayzPublishObj call server_publishObj;
};
["dayzPublishObj",[dayz_characterID,_tent,[_dir,_location],"TentStorage"]] call callRpcProcedure;
cutText [localize "str_success_tent_pitch", "PLAIN DOWN"];
} else {

View File

@@ -25,13 +25,7 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then {
// server_tradeObject [_activatingPlayer,_traderID,_bos]
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
if (isServer) then {
dayzTradeObject call server_tradeObject;
};
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
@@ -63,13 +57,7 @@ if (_qty >= _qty_in) then {
_veh setVariable ["characterID",dayz_playerUID,true];
// server_publishVeh [_veh,[_dir,_objPosition],_vehicle,true,dayz_characterID]
dayzPublishVeh = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
publicVariableServer "dayzPublishVeh";
if (isServer) then {
dayzPublishVeh call server_publishVeh;
};
["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
@@ -82,11 +70,7 @@ if (_qty >= _qty_in) then {
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
if (isServer) then {
dayzDeleteObj call local_deleteObj;
};
["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;

View File

@@ -25,13 +25,7 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then {
// server_tradeObject [_activatingPlayer,_traderID,_bos]
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
if (isServer) then {
dayzTradeObject call server_tradeObject;
};
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
@@ -63,13 +57,7 @@ if (_qty >= _qty_in) then {
_veh setVariable ["characterID",dayz_playerUID,true];
// server_publishVeh [_veh,[_dir,_objPosition],_vehicle,true,dayz_characterID]
dayzPublishVeh = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
publicVariableServer "dayzPublishVeh";
if (isServer) then {
dayzPublishVeh call server_publishVeh;
};
["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
@@ -82,11 +70,7 @@ if (_qty >= _qty_in) then {
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
if (isServer) then {
dayzDeleteObj call local_deleteObj;
};
["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;

View File

@@ -27,13 +27,7 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then {
// server_tradeObject [_activatingPlayer,_traderID,_bos]
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
if (isServer) then {
dayzTradeObject call server_tradeObject;
};
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];

View File

@@ -21,13 +21,7 @@ if (_qty >= _qty_in) then {
_bos = 1;
};
// server_tradeObject [_activatingPlayer,_traderID,_bos]
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
if (isServer) then {
dayzTradeObject call server_tradeObject;
};
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];

View File

@@ -23,14 +23,7 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then {
// server_tradeObject [_activatingPlayer,_traderID,_bos]
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
if (isServer) then {
dayzTradeObject call server_tradeObject;
};
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
waitUntil {!isNil "dayzTradeResult"};

View File

@@ -57,13 +57,7 @@ if (!_isOk) then {
_tent setVariable ["characterID",dayz_playerUID,true];
_tent setVariable ["OEMPos",_location,true];
//player setVariable ["tentUpdate",["Land_A_tent",_dir,_location,[dayz_tentWeapons,dayz_tentMagazines,dayz_tentBackpacks]],true];
dayzPublishObj = [dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"];
publicVariable "dayzPublishObj";
if (isServer) then {
dayzPublishObj call server_publishObj;
};
["dayzPublishObj",[dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"]] call callRpcProcedure;
cutText ["You have setup your vault", "PLAIN DOWN"];
} else {

View File

@@ -548,14 +548,14 @@ class Citizen1; // External class reference
class DZ_Czech_Vest_Puch: Bag_Base_EP1
{
scope = 2;
displayName = "Czech Vest Pouch";
picture = "\ca\weapons_e\data\icons\backpack_ACR_small_CA.paa";
displayname = "Czech Vest Pouch";
icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa";
mapsize = 2;
model = "\ca\weapons_e\AmmoBoxes\backpack_acr_small.p3d";
transportMaxWeapons = 0;
transportMaxMagazines = 12;
picture = "\ca\weapons_e\data\icons\backpack_ACR_small_CA.paa";
scope = 2;
transportmaxmagazines = 12;
transportmaxweapons = 0;
};
class DZ_ALICE_Pack_EP1: Bag_Base_EP1

View File

@@ -8,10 +8,10 @@ _originalPos = getPosATL _obj;
if (_canLoot) then {
//Get zombie class
_unitTypes = getArray (_config >> "zombieClass");
_min = getNumber (_config >> "maxRoaming");
_max = getNumber (_config >> "minRoaming");
_min = getNumber (_config >> "minRoaming");
_max = getNumber (_config >> "maxRoaming");
//Walking Zombies
_num = round(random _max) max _min;
_num = round(random _max) min _min;
_config = configFile >> "CfgBuildingLoot" >> _type;
//Get zombie class
_zombieChance = getNumber (_config >> "zombieChance");

View File

@@ -182,7 +182,7 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
if ((isPlayer _unit) and !(_charID in _friendlies)) then {
r_action = true;
_action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", "_target != player"];
_action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", "vehicle _unit == _unit"];
r_player_actions set [count r_player_actions,_action];
};

View File

@@ -31,8 +31,8 @@ _sourceZombie = _source isKindOf "zZombie_base";
if (_isPlayer) then {
if (_damage > 0.1) then {
dayz_canDisconnect = false;
dayzDiscoAdd = getPlayerUID player;
publicVariable "dayzDiscoAdd";
["dayzDiscoAdd",getPlayerUID player] call callRpcProcedure;
dayz_damageCounter = time;
//Ensure Control is visible
@@ -56,10 +56,7 @@ if (_unit == player) then {
_myKills = 200 - (((player getVariable ["humanKills",0]) / 30) * 100);
//Process Morality Hit
_humanityHit = -(_myKills * _damage);
_id = [_source,_humanityHit] spawn {
dayzHumanity = [_this select 0,_this select 1,30];
publicVariable "dayzHumanity";
};
["dayzHumanity",[_source,_humanityHit,30]] call broadcastRpcCallAll;
};
};
};
@@ -169,9 +166,7 @@ if (_damage > 0.4) then { //0.25
if(!_isPZombie) then {
//Create Wound
_unit setVariable[_wound,true,true];
[_unit,_wound,_hit] spawn fnc_usec_damageBleed;
usecBleed = [_unit,_wound,_hit];
publicVariable "usecBleed";
["usecBleed",[_unit,_wound,_hit]] call broadcastRpcCallAll;
//Set Injured if not already
_isInjured = _unit getVariable["USEC_injured",false];

View File

@@ -16,6 +16,7 @@ _hasFuelE = "ItemJerrycanEmpty" in magazines player;
_hasRawMeat = "FoodSteakRaw" in magazines player;
_hasKnife = "ItemKnife" in items player;
_hasToolbox = "ItemToolbox" in items player;
_hasstatsenabled = player getVariable ["StatsEnabled",false];
//_hasTent = "ItemTent" in items player;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_nearLight = nearestObject [player,"LitObject"];
@@ -28,6 +29,14 @@ if (!isNull _nearLight) then {
};
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
if (!_hasstatsenabled) then {
if (s_player_stats < 0) then {
// s_player_stats = player addAction [format[localize "str_actions_stats",_text], "\z\addons\dayz_code\actions\playerstats.sqf"];
(findDisplay 46) displayAddEventHandler ["keyDown", "_this call fnc_onKeyDown"];
s_player_stats = 1;
};
};
//Grab Flare
if (_canPickLight and !dayz_hasLight) then {
if (s_player_grabflare < 0) then {

View File

@@ -1,4 +1,4 @@
private["_unit","_selection","_strH","_dam","_total"];
private["_unit","_selection","_strH","_damage","_total"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
@@ -9,15 +9,8 @@ if (_selection != "" and local _unit) then {
//player sidechat str _damage;
_unit setVariable [_strH,_damage,true];
if (_damage == 0) then {
dayzUpdateVehicle = [_unit,"repair"];
["dayzUpdateVehicle",[_unit,"repair"]] call callRpcProcedure;
} else {
dayzUpdateVehicle = [_unit,"damage"];
};
if (isServer) then {
if (allowConnection) then {
dayzUpdateVehicle call server_updateObject;
};
} else {
publicVariable "dayzUpdateVehicle";
["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
};
};

View File

@@ -1,4 +1,4 @@
private["_unit","_selection","_strH","_dam","_total"];
private["_unit","_selection","_damage","_strH","_dam","_total"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
@@ -12,14 +12,7 @@ if ((_selection != "") and local _unit) then {
_unit setVariable [_strH,_total,true];
if (_damage >= 1) then {
dayzUpdateVehicle = [_unit,"damage"];
if (isServer) then {
if (allowConnection) then {
dayzUpdateVehicle call server_updateObject;
};
} else {
publicVariable "dayzUpdateVehicle";
};
["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
};
} else {

View File

@@ -1,4 +1,4 @@
private["_unit","_selection","_strH","_dam","_total"];
private["_unit","_killer","_type","_pos","_dir"];
_unit = _this select 0;
_killer = _this select 1;
_type = typeOf _unit;
@@ -6,5 +6,4 @@ _pos = getposATL _unit;
_dir = direction _unit;
if (local _unit) then {
deleteVehicle _unit;
// [_type,_pos,_dir] spawn object_spawnDamVehicle;
};

View File

@@ -13,11 +13,7 @@ if (r_player_infected) then {
};
//Send Death Notice
dayzDeath = [dayz_characterID,0,_body,_playerID,dayz_playerName,_infected];
publicVariableServer "dayzDeath";
if (isServer) then {
_id = dayzDeath spawn server_playerDied;
};
["dayzDeath",[dayz_characterID,0,_body,_playerID,dayz_playerName,_infected]] call callRpcProcedure;
_id = [player,50,true,getPosATL player] spawn player_alertZombies;
@@ -66,8 +62,7 @@ if (count _array > 0) then {
_wait = 0;
};
if (!_canHitFree and !_isBandit) then {
dayzHumanity = [_source,_humanity,_wait];
publicVariable "dayzHumanity";
["dayzHumanity",[_source,_humanity,_wait]] call broadcastRpcCallAll;
};
};
};
@@ -124,10 +119,7 @@ if (count _array > 0) then {
_body setVariable["combattimeout", 0, true];
/*
dayzFlies = player;
publicVariable "dayzFlies";
*/
//["dayzFlies",player] call broadcastRpcCallAll;
sleep 2;
1 cutRsc ["DeathScreen","BLACK OUT",3];

View File

@@ -60,16 +60,14 @@ if (_ammo isKindOf "SmokeShell") then {
if (_ammo isKindOf "RoadFlare") then {
//hint str(_ammo);
_projectile = nearestObject [_unit, "RoadFlare"];
_id = [_projectile,0] spawn object_roadFlare;
dayzRoadFlare = [_projectile,0];
publicVariable "dayzRoadFlare";
["dayzRoadFlare",[_projectile,0]] call broadcastRpcCallAll;
_id = _this spawn player_throwObject;
};
if (_ammo isKindOf "ChemLight") then {
_projectile = nearestObject [_unit, "ChemLight"];
_id = [_projectile,1] spawn object_roadFlare;
dayzRoadFlare = [_projectile,1];
publicVariable "dayzRoadFlare";
["dayzRoadFlare",[_projectile,1]] call broadcastRpcCallAll;
_id = _this spawn player_throwObject;
};
};

View File

@@ -1,8 +1,7 @@
private ["_objects"];
_objects = nearestObjects [getPosATL player, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage"], 10];
{
dayzUpdateVehicle = [_x,"gear"];
publicVariableServer "dayzUpdateVehicle";
["dayzUpdateVehicle",[_x,"gear"]] call callRpcProcedure;
} foreach _objects;
private["_dialog","_magazineArray","_control","_item","_val","_max"];

View File

@@ -46,9 +46,7 @@ if (count _medical > 0) then {
//Add Wounds
{
player setVariable[_x,true,true];
[player,_x,_hit] spawn fnc_usec_damageBleed;
usecBleed = [player,_x,0];
publicVariable "usecBleed";
["usecBleed",[player,_x,_hit]] call broadcastRpcCallAll;
} forEach (_medical select 8);
//Add fractures
@@ -77,11 +75,8 @@ player setVariable["worldspace",_worldspace,true];
player setVariable["friendlies",_friendlies,true];
player setVariable["tagList",_tagList,true];
dayzPlayerMorph = [_charID,player,_playerUID,[_zombieKills,_headShots,_humanKills,_banditKills],_humanity];
publicVariable "dayzPlayerMorph";
if (isServer) then {
dayzPlayerMorph call server_playerMorph;
};
//code for this on the server is missing
//["dayzPlayerMorph",[_charID,player,_playerUID,[_zombieKills,_headShots,_humanKills,_banditKills],_humanity]] call callRpcProcedure;
call dayz_resetSelfActions;

View File

@@ -34,12 +34,7 @@ if(_ownerID == dayz_characterID) then {
_magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
if (isServer) then {
dayzDeleteObj call local_deleteObj;
};
["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;
//Add weapons

View File

@@ -34,11 +34,7 @@ if(_ownerID == dayz_playerUID) then {
_magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
if (isServer) then {
dayzDeleteObj call local_deleteObj;
};
["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;

View File

@@ -7,6 +7,7 @@ _dateNow = (DateToNumber date);
_maxZombies = dayz_maxLocalZombies;
_maxWildZombies = 3;
_age = -1;
_nearbyBuildings = [];
_radius = 200;
_maxZombies = 10;
@@ -23,20 +24,37 @@ diag_log ("Type: " +str(_type));
switch (_nearbytype) do {
case "NameVillage": {
_radius = 250;
//_radius = 250;
_maxZombies = 30;
};
case "NameCity": {
_radius = 300;
//_radius = 300;
_maxZombies = 40;
};
case "NameCityCapital": {
_radius = 400;
//_radius = 400;
_maxZombies = 50;
};
};
_spawnZombies = count (_position nearEntities ["zZombie_Base",_radius]) < _maxZombies;
_spawnZombies = count (_position nearEntities ["zZombie_Base",_radius+100]) < _maxZombies;
if ("ItemMap_Debug" in items player) then {
deleteMarkerLocal "MaxZeds";
deleteMarkerLocal "Counter";
_markerstr = createMarkerLocal ["MaxZeds", _position];
_markerstr setMarkerColorLocal "ColorRed";
_markerstr setMarkerShapeLocal "ELLIPSE";
_markerstr setMarkerBrushLocal "Border";
_markerstr setMarkerSizeLocal [_radius, _radius];
_markerstr1 = createMarkerLocal ["Counter", _position];
_markerstr1 setMarkerColorLocal "ColorYellow";
_markerstr1 setMarkerShapeLocal "ELLIPSE";
_markerstr1 setMarkerBrushLocal "Border";
_markerstr1 setMarkerSizeLocal [_radius+100, _radius+100];
};
switch (_type) do {
case "Zeds": {
@@ -49,8 +67,16 @@ switch (_type) do {
};
};
};
case "Wild": {
case "both": {
//[_position, _maxZombies] call wild_spawnZombies;
_nearbyBuildings = nearestObjects [_position, dayz_ZombieBuildings, _radius];
_nearbyCount = count _nearbyBuildings;
if (_nearbyCount > 0) then {
[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _nearbyBuildings] call player_spawnlootCheck;
if (_spawnZombies) then {
[_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _maxZombies, _nearbyBuildings] call player_spawnzedCheck;
};
};
};
case "Loot": {
//_nearbyBuildings = nearestObjects [_position, ["building"], _radius];

View File

@@ -189,5 +189,5 @@ private ["_newBackpackType","_backpackWpn","_backpackMag"];
_playerUID=getPlayerUID player;
_playerObjName = format["player%1",_playerUID];
call compile format["player%1 = player;",_playerUID];
call compile format["%1 = player;",_playerObjName];
publicVariable _playerObjName;

View File

@@ -1,4 +1,4 @@
private["_unit","_targets","_move","_damage","_wound","_index","_cnt","_sound","_local","_dir","_hpList","_hp","_strH","_dam","_total","_result","_vehicle","_tPos","_zPos","_cantSee","_inAngle"];
private["_unit","_targets","_move","_damage","_wound","_index","_cnt","_sound","_local","_dir","_hpList","_hp","_strH","_dam","_total","_vehicle","_tPos","_zPos","_cantSee","_inAngle"];
_unit = _this select 0;
_type = _this select 1;
_vehicle = (vehicle player);
@@ -40,9 +40,7 @@ if (_vehicle != player) then {
//diag_log ("Hitpoints " +str(_wound) +str(_total));
//_result = [_vehicle, _wound,_total, _unit,"zombie"] call fnc_usec_damageVehicle;
//dayzHitV = [_vehicle,_wound,_total, _unit,"zombie"];
//publicVariable "dayzHitV";
//["dayzHitV",[_vehicle, _wound,_total, _unit,"zombie"]] call broadcastRpcCallAll;
if (_total >= 1) then {
if ((_chance % 4) == 0) then {
if ((_vehicle isKindOf "ATV_Base_EP1") or (_vehicle isKindOf "Motorcycle")) then { player action ["eject", _vehicle] };
@@ -65,9 +63,7 @@ if (_vehicle != player) then {
//publicVariable "dayzHit";
[_unit,"hit",2,true] call dayz_zombieSpeak;
} else {
_result = [_vehicle, _wound,_total, _unit,"zombie"] call fnc_usec_damageVehicle;
dayzHitV = [_vehicle,_wound,_total, _unit,"zombie"];
publicVariable "dayzHitV";
["dayzHitV",[_vehicle, _wound,_total, _unit,"zombie"]] call broadcastRpcCallAll;
};
};
} else {

View File

@@ -31,7 +31,6 @@ _multiplier = 1;
_delta = _pHeight - _entHeight;
if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then {
zedattack = [_x, _type] spawn player_zombieAttack;
waitUntil {scriptDone zedattack};
_x setVariable["lastAttack",time];
};
_attacked = true;

View File

@@ -23,14 +23,7 @@ if (_dam < 1 ) then {
_unit setVariable [_strH,_total,true];
if ( !_needUpdate ) then {
_unit setVariable ["needUpdate",true,true];
dayzUpdateVehicle = [_unit,"damage"];
if (isServer) then {
if (allowConnection) then {
dayzUpdateVehicle call server_updateObject;
};
} else {
publicVariableServer "dayzUpdateVehicle";
};
["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
};
};
};

View File

@@ -1,4 +1,4 @@
private["_unit","_selection","_killer"];
private["_unit","_hitPoints","_selection","_killer"];
_unit = _this select 0;
_killer = _this select 1;
@@ -9,15 +9,7 @@ _hitPoints = _unit call vehicle_getHitpoints;
_unit setVariable [_selection, 1, true];
} forEach _hitPoints;
dayzUpdateVehicle = [_unit, "damage", true];
if (isServer) then {
if (allowConnection) then {
dayzUpdateVehicle call server_updateObject;
};
} else {
publicVariable "dayzUpdateVehicle";
};
["dayzUpdateVehicle",[_unit, "damage", true]] call callRpcProcedure;
_unit removeAllEventHandlers "HandleDamage";
_unit removeAllEventHandlers "Killed";

View File

@@ -63,7 +63,6 @@ if (_doLoiter) then {
};
};
if (isNull _agent) exitWith {
dayz_spawnZombies = dayz_spawnZombies - 1;
};
@@ -83,6 +82,7 @@ if (_rnd > 0.3) then {
_array = []+ getArray (configFile >> "cfgLoot" >> getText(_lootType));
if (count _array > 0) then {
_loot = _array call BIS_fnc_selectRandomWeighted;
//diag_log ("Zed Loot: " +(_loot));
if(!isNil "_array") then {
_agent addMagazine _loot;
};

View File

@@ -33,7 +33,7 @@ class CfgMods
hidePicture = 0;
hideName = 0;
action = "http://www.dayzmod.com";
version = "1.7.5.M1D9";
version = "1.7.5.M1D15";
hiveVersion = 0.96; //0.93
};
};
@@ -94,9 +94,11 @@ class RscStructuredTextGUI: RscStructuredText
//#include "CfgWorlds.hpp"
#include "cfgMoves.hpp"
#include "rscTitles.hpp"
#include "cfgVehicles.hpp"
//#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CfgMagazines.hpp"
#include "cfgLoot.hpp"
#include "CfgMarkers.hpp"
class CfgSurvival {
class Inventory {
@@ -110,10 +112,12 @@ class CfgSurvival {
};
class Meat {
class Default {
yield = 1;
yield = 2;
rawfoodtype = "FoodSteakRaw";
};
class Cow: Default {
yield = 6;
yield = 8;
rawfoodtype = "FoodSteakRaw";
};
class Cow01: Cow{};
class Cow02: Cow{};
@@ -121,12 +125,27 @@ class CfgSurvival {
class Cow04: Cow{};
class Goat: Default {
yield = 4;
rawfoodtype = "FoodSteakRaw";
};
class Sheep: Default {
yield = 3;
yield = 4;
rawfoodtype = "FoodmuttonRaw";
};
class WildBoar: Default {
yield = 2;
yield = 4;
rawfoodtype = "FoodbaconRaw";
};
class Hen: Default {
yield = 4;
rawfoodtype = "FoodchickenRaw";
};
class Cock: Default {
yield = 4;
rawfoodtype = "FoodchickenRaw";
};
class Rabbit: Default {
yield = 4;
rawfoodtype = "FoodrabbitRaw";
};
};
};

View File

@@ -284,8 +284,18 @@ if (!isDedicated) then {
dayz_spaceInterrupt = {
private ["_dikCode", "_handled"];
_dikCode = _this select 1;
_altState = _this select 4;
_handled = false;
if (_dikCode in (actionKeys "GetOver")) then {
if (animationState player in ["amovpercmrunslowwrfldf","amovpercmrunsraswrfldf","amovpercmevaslowwrfldf","amovpercmevasraswrfldf"]) then {
null = [] spawn {
//Needed for sync with others
[nil, player, rSWITCHMOVE,"ActsPercMrunSlowWrflDf_FlipFlopPara"] call RE;
sleep 0.3;
player setVelocity [(velocity player select 0) + 1.5 * sin direction player, (velocity player select 1) + 1.5 * cos direction player, (velocity player select 2) + 4];
};
_handled = true;
};
};
//if (_dikCode == 57) then {_handled = true}; // space
//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
@@ -384,6 +394,18 @@ if (!isDedicated) then {
_vdir
};
fnc_onKeyDown =
{
private["_key"];
_key = _this select 1;
if (_key == 70) then //SCROLL LOCK
{
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
_shift = nil;
};
_return
};
dayz_lowHumanity = {
private["_unit","_humanity","_delay"];
_unit = _this;
@@ -417,21 +439,10 @@ if (!isDedicated) then {
dayz_originalPlayer = player;
};
BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
//Server Only
if (isServer) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
} else {
eh_localCleanup = {};
};
progressLoadingScreen 0.8;
//Both
//Start Dynamic Weather
execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
fnc_usec_damageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf"; //Event handler run on damage
zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
@@ -452,10 +463,8 @@ if (isServer) then {
fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit
vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (or local to unit) when gutting an object
local_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf"; //Generated on the server (or local to unit) when gutting an object
local_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage
local_sefFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
local_setFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed
//player_weaponCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponCheck.sqf"; //Run by the player or server to monitor whether they have picked up a new weapon
curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
@@ -500,4 +509,15 @@ if (isServer) then {
_medical
};
//Server Only
if (isServer) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
} else {
eh_localCleanup = {};
};
//Start Dynamic Weather
execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
initialized = true;

View File

@@ -1,46 +1,82 @@
"dayzSetFuel" addPublicVariableEventHandler {(_this select 1) call local_sefFuel};
rpcCodeVarName = { format["%1_code",_this] };
rpcDirectCall = { call compile format["[%1,%2] call %3;",str(_this),_this,_this call rpcCodeVarName]; };
//run on all clients
broadcastRpcCallAll = {
private["_name","_val"];
_name = _this select 0;
_val = _this select 1;
call compile format["%1 = _val;",_name]; //set the value locally
_name call rpcDirectCall; //call on this client
publicVariable _name; //call on other clients
};
//run on client which has the object ownership
broadcastRpcCallIfLocal = {
private["_name","_val","_reqObj"];
_name = _this select 0;
_val = _this select 1;
_reqObj = _this select 2;
call compile format["%1 = _val;",_name]; //set the value locally
if (local _reqObj) then {
_name call rpcDirectCall; //call on this client
} else {
publicVariable _name; //call on other clients
}
};
//only run on server
callRpcProcedure = {
private["_name","_val"];
_name = _this select 0;
_val = _this select 1;
call compile format["%1 = _val;",_name]; //set the value locally
if (isServer) then {
"dayzDeath" addPublicVariableEventHandler {(_this select 1) call server_playerDied};
"dayzDiscoAdd" addPublicVariableEventHandler {dayz_disco set [count dayz_disco,(_this select 1)];};
"dayzDiscoRem" addPublicVariableEventHandler {dayz_disco = dayz_disco - [(_this select 1)];};
"dayzPlayerSave" addPublicVariableEventHandler {(_this select 1) call server_playerSync;};
"dayzPublishObj" addPublicVariableEventHandler {(_this select 1) call server_publishObj};
"dayzUpdateVehicle" addPublicVariableEventHandler {(_this select 1) call server_updateObject};
"dayzDeleteObj" addPublicVariableEventHandler {(_this select 1) call local_deleteObj};
"dayzPublishVeh" addPublicVariableEventHandler {(_this select 1) call server_publishVeh}; // for vehicle traders
"dayzTradeObject" addPublicVariableEventHandler {(_this select 1) call server_tradeObj}; // for vehicle traders
"dayzTraderMenu" addPublicVariableEventHandler {(_this select 1) call server_traders}; // for all traders
"dayzLogin" addPublicVariableEventHandler {(_this select 1) call server_playerLogin};
"dayzLogin2" addPublicVariableEventHandler {(_this select 1) call server_playerSetup};
"dayzPlayerMorph" addPublicVariableEventHandler {(_this select 1) call server_playerMorph};
"dayzLoginRecord" addPublicVariableEventHandler {(_this select 1) call dayz_recordLogin};
"dayzCharDisco" addPublicVariableEventHandler {(_this select 1) call server_characterSync};
"dayzSetFix" addPublicVariableEventHandler {(_this select 1) call object_setFixServer};
"dayzGutBody" addPublicVariableEventHandler {(_this select 1) spawn local_gutObject};
"usecMorphine" addPublicVariableEventHandler {
(_this select 1) select 0 setVariable["hit_legs",0];
(_this select 1) select 0 setVariable["hit_hands",0];
_name call rpcDirectCall; //call here since we are the server
} else {
publicVariableServer _name; //call on the sever
};
};
//register client->client rpc
registerBroadcastRpc = {
private["_name","_code"];
_name = _this select 0;
_code = _this select 1;
call compile format["%1 = _code;",_name call rpcCodeVarName]; //set the global var containing the EH code
_name addPublicVariableEventHandler _code;
};
//both
["dayzSetFuel", { (_this select 1) call local_setFuel; } ] call registerBroadcastRpc;
["dayzSetFix", { (_this select 1) call object_setFixServer; } ] call registerBroadcastRpc;
["dayzSetDate", { setDate (_this select 1); } ] call registerBroadcastRpc;
//EHs that setVariable "medForceUpdate" need to run on the server too
["usecMorphine", { (_this select 1) call player_medMorphine; } ] call registerBroadcastRpc;
["usecBandage", { (_this select 1) call player_medBandage; } ] call registerBroadcastRpc;
["usecEpi", { (_this select 1) call player_medEpi; } ] call registerBroadcastRpc;
["usecTransfuse", { (_this select 1) call player_medTransfuse; } ] call registerBroadcastRpc;
["usecPainK", { (_this select 1) call player_medPainkiller; } ] call registerBroadcastRpc;
//BIS_Effects_Burn is empty on the server anyway, but this EH is called
["dayzFire", { (_this select 1) spawn BIS_Effects_Burn; } ] call registerBroadcastRpc;
//server only
if (isServer) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\publicEH_server.sqf";
};
//clients only
if (!isDedicated) then {
"norrnRaLW" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\load_wounded.sqf"};
"norrnRLact" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf"};
"usecMorphine" addPublicVariableEventHandler {(_this select 1) call player_medMorphine};
"usecBleed" addPublicVariableEventHandler {_id = (_this select 1) spawn fnc_usec_damageBleed};
"usecBandage" addPublicVariableEventHandler {(_this select 1) call player_medBandage};
"usecEpi" addPublicVariableEventHandler {(_this select 1) call player_medEpi};
"usecTransfuse" addPublicVariableEventHandler {(_this select 1) call player_medTransfuse};
"usecPainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller};
"dayzHideBody" addPublicVariableEventHandler {hideBody (_this select 1)};
"dayzHumanity" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
"dayzHitV" addPublicVariableEventHandler {(_this select 1) call fnc_usec_damageVehicle};
["norrnRaLW", { [_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\load_wounded.sqf"; }] call registerBroadcastRpc;
["norrnRLact", { [_this select 1] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf"; } ] call registerBroadcastRpc;
["usecBleed", { (_this select 1) spawn fnc_usec_damageBleed; } ] call registerBroadcastRpc;
["dayzHideBody", { hideBody (_this select 1); } ] call registerBroadcastRpc;
["dayzHumanity", { (_this select 1) spawn player_humanityChange; } ] call registerBroadcastRpc;
["dayzHitV", { (_this select 1) call fnc_usec_damageVehicle; } ] call registerBroadcastRpc;
"dayzSetDate" addPublicVariableEventHandler {setDate (_this select 1)};
"dayzFlies" addPublicVariableEventHandler {(_this select 1) call spawn_flies};
"dayzRoadFlare" addPublicVariableEventHandler {(_this select 1) spawn object_roadFlare};
"norrnRaDrag" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"};
"dayzFire" addPublicVariableEventHandler {nul=(_this select 1) spawn BIS_Effects_Burn};
["dayzFlies", { (_this select 1) call spawn_flies; } ] call registerBroadcastRpc;
["dayzRoadFlare", { (_this select 1) spawn object_roadFlare; } ] call registerBroadcastRpc;
["norrnRaDrag", { [_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"; } ] call registerBroadcastRpc;
};

View File

@@ -51,9 +51,6 @@ SleepWater = 1440; //minutes (24 hours)
SleepTemperatur = 90 / 100; //Firs Value = Minutes untill Player reaches the coldest Point at night (without other effects! night factor expected to be -1) //TeeChange
//Server Variables
dayZ_hivePipe1 = "\\.\pipe\dayz"; //The named pipe
dayZ_hivePipeAuth = "\\.\pipe\dayzAuth"; //The named pipe
hiveInUse = false;
allowConnection = false;
isSinglePlayer = false;
dayz_serverObjectMonitor = [];
@@ -93,6 +90,7 @@ dayz_resetSelfActions = {
s_player_deleteBuild = -1;
s_player_forceSave = -1;
s_player_flipveh = -1;
s_player_stats = -1;
s_player_sleep = -1;
s_player_movedog = -1;
s_player_speeddog = -1;

View File

@@ -34,18 +34,14 @@ while {r_doLoop} do {
r_doLoop = false;
if (_finished) then {
usecBandage = [_unit,player];
publicVariable "usecBandage";
["usecBandage",[_unit,player]] call broadcastRpcCallAll;
if (_unit == player) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
dayz_sourceBleeding = objNull;
} else {
dayzHumanity = [player,20];
_id = dayzHumanity spawn player_humanityChange;
["dayzHumanity",[player,20]] call dayzHumanity_code;
};
{_unit setVariable[_x,false,true];} forEach USEC_woundHit;

View File

@@ -24,9 +24,7 @@ sleep 2;
//unconscious unit assumes dragging posture
//public EH
norrnRaDrag = _dragee;
publicVariable "norrnRaDrag";
_dragee switchmove "ainjppnemstpsnonwrfldb_still";
["norrnRaDrag",_dragee] call broadcastRpcCallAll;
_dragee attachto [_unit,[0.1, 1.01, 0]];
sleep 0.02;

View File

@@ -12,9 +12,7 @@ if (!_isDead) then {
_unit setVariable ["NORRN_unconscious", false, true];
_unit setVariable ["USEC_isCardiac",false,true];
sleep 5;
usecEpi = [_unit,player,"ItemEpinephrine"];
publicVariable "usecEpi";
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
["usecEpi",[_unit,player,"ItemEpinephrine"]] call broadcastRpcCallAll;
};
r_action = false;

View File

@@ -20,9 +20,7 @@ if ((_vcl emptyPositions "cargo") > 0) then
_dragger switchMove "";
_wounded setVariable ["NORRN_LoadVcl", _vcl, true];
sleep 1;
[_wounded] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf";
norrnRLact = _wounded;
publicVariable "norrnRLact";
["norrnRLact",_wounded] call broadcastRpcCallAll;
player removeAction NORRN_dropAction;
}else{

View File

@@ -14,9 +14,7 @@ _wounded setVariable ["NORRN_unit_dragged", true, true];
_wounded assignAsCargo _vcl;
_wounded moveInCargo _vcl;
sleep 1;
norrnRALW = _wounded;
publicVariable "norrnRALW";
_wounded switchMove "kia_hmmwv_driver";
["norrnRALW",_wounded] call broadcastRpcCallAll;
if (local _wounded) then
{

View File

@@ -16,9 +16,7 @@ _wounded setVariable ["NORRN_unit_dragged", true, true];
_wounded assignAsCargo _vcl;
_wounded moveInCargo _vcl;
sleep 1;
norrnRALW = _wounded;
publicVariable "norrnRALW";
_wounded switchMove "kia_hmmwv_driver";
["norrnRALW",_wounded] call broadcastRpcCallAll;
if (local _wounded) then
{

View File

@@ -38,14 +38,12 @@ if (_finished) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
} else {
dayzHumanity = [player,50];
_id = dayzHumanity spawn player_humanityChange;
["dayzHumanity",[player,50]] call dayzHumanity_code;
};
player removeMagazine "ItemMorphine";
usecMorphine = [_unit,player];
publicVariable "usecMorphine";
["usecMorphine",[_unit,player]] call broadcastRpcCallAll;
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;

View File

@@ -15,12 +15,11 @@ if (_unit == player) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
} else {
dayzHumanity = [player,20];
_id = dayzHumanity spawn player_humanityChange;
["dayzHumanity",[player,20]] call dayzHumanity_code;
};
player removeMagazine "ItemPainkiller";
sleep 1;
usecPainK = [_unit,player];
publicVariable "usecPainK";
//clear the healed player's vision
["usecPainK",[_unit,player]] call broadcastRpcCallAll;

View File

@@ -9,14 +9,16 @@ if (local _unit) then {_unit setCaptive false};
if (!_isDead) then {
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
_unit setVariable ["NORRN_unconscious", false, true];
_unit setVariable ["USEC_isCardiac",false,true];
//no need to public broadcast the variables since this runs on every peer
_unit setVariable ["NORRN_unconscious", false, false];
_unit setVariable ["USEC_isCardiac",false, false];
if (_unit == player) then {
r_player_unconscious = false;
disableUserInput false;
r_player_cardiac = false;
r_player_handler1 = false;
};
if (isServer) then {
_unit setVariable["medForceUpdate",true];
};

View File

@@ -18,8 +18,8 @@ if (_unit == player) then {
_id = false spawn dayz_disableRespawn;
};
_unit setVariable ["hit_legs",0];
_unit setVariable ["hit_hands",0];
_unit setVariable ["hit_legs",0,false];
_unit setVariable ["hit_hands",0,false];
if (isServer) then {
_unit setVariable["medForceUpdate",true];

View File

@@ -5,6 +5,9 @@ _array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
_rndInfection = (random 15);
_TransfusionInfection = (_rndInfection < 1);
if (_unit == player) then {
r_player_blood = r_player_bloodTotal;
r_player_lowblood = false;
@@ -12,6 +15,11 @@ if (_unit == player) then {
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
if (_TransfusionInfection) then {
r_player_infected = true;
player setVariable["USEC_infected",true];
};
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1300;

View File

@@ -155,7 +155,7 @@ fnc_usec_damageBleed = {
/***********************************************************
PROCESS DAMAGE TO A UNIT
- Function
- [_unit, _wound] call fnc_usec_damageBleed;
- [_unit, _wound, _injury] call fnc_usec_damageBleed;
************************************************************/
private["_unit","_wound","_injury","_modelPos","_point","_source"];
_unit = _this select 0;
@@ -229,6 +229,7 @@ fnc_usec_damageBleed = {
};
fnc_usec_recoverUncons = {
//same actions as in the EH, just timed differently
player setVariable ["NORRN_unconscious", false, true];
player setVariable ["unconsciousTime", 0, true];
player setVariable ["USEC_isCardiac",false,true];

View File

@@ -3,6 +3,9 @@ _unit = (_this select 3) select 0;
_lowBlood = _unit getVariable ["USEC_lowBlood", false];
_injured = _unit getVariable ["USEC_injured", false];
_inPain = _unit getVariable ["USEC_inPain", false];
_lastused = _unit getVariable ["LastTransfusion", time];
if (_lastused - time < 600) exitwith {cutText [format[(localize "str_actions_medical_18"),_text] , "PLAIN DOWN"]};
call fnc_usec_medic_removeActions;
r_action = false;
@@ -35,12 +38,12 @@ while {r_doLoop} do {
r_doLoop = false;
if (_finished) then {
_unit setVariable["LastTransfusion",time,true];
_unit setVariable["USEC_lowBlood",false,true];
player removeMagazine "ItemBloodbag";
usecTransfuse = [_unit,player];
publicVariable "usecTransfuse";
dayzHumanity = [player,250];
_id = dayzHumanity spawn player_humanityChange;
["usecTransfuse",[_unit,player]] call broadcastRpcCallAll;
["dayzHumanity",[player,250]] call dayzHumanity_code;
} else {
r_interrupt = false;
player switchMove "";

View File

@@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version
{
idc = -1;
text = "DayZ 1.7.5.M1D9";
text = "DayZ 1.7.5.M1D15";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
};
class CA_TitleMainMenu;

View File

@@ -167,6 +167,12 @@
<German>Du hast eine(n) %1 gebaut</German>
<Russian>Вы построили %1.</Russian>
</Key>
<Key ID="str_build_failed_01">
<Original>You have failed to build %1.</Original>
<English>You have failed to build %1.</English>
<German>You have failed to build %1.</German>
<Russian>You have failed to build %1.</Russian>
</Key>
<Key ID="str_fireplace_02">
<Original>You cannot make a fireplace here. The area must be flat, and free of other objects</Original>
<English>You cannot make a fireplace here. The area must be flat, and free of other objects</English>
@@ -609,6 +615,12 @@
<German>%1 löschen</German>
<Russian>Погасить %1</Russian>
</Key>
<Key ID="str_actions_medical_18">
<Original>You cannot perform another blood transfusion so fast</Original>
<English>You cannot perform another blood transfusion so fast</English>
<German>You cannot perform another blood transfusion so fast</German>
<Russian>You cannot perform another blood transfusion so fast</Russian>
</Key>
<Key ID="str_action_studybody">
<Original>Study Body</Original>
<English>Study Body</English>
@@ -639,6 +651,12 @@
<German>Turn Over %1</German>
<Russian>Turn Over %1</Russian>
</Key>
<Key ID="str_actions_stats">
<Original>Enable Stats</Original>
<English>Enable Stats</English>
<German>Enable Stats</German>
<Russian>Enable Stats</Russian>
</Key>
<Key ID="str_actions_self_sleep">
<Original>Sleep</Original>
<English>Sleep</English>
@@ -724,4 +742,150 @@
<Russian>Позвать собаку</Russian>
</Key>
</Package>
<Package name="equipment_code">
<Key ID="STR_EQUIP_CODE_NAME_3">
<Original>Box of Wet Matches</Original>
<English>Box of Wet Matches</English>
<German>Box of Wet Matches</German>
<Russian>Box of Wet Matches</Russian>
</Key>
<Key ID="STR_EQUIP_CODE_DESC_3">
<Original>Box of wet matches.</Original>
<English>Box of wet matches.</English>
<German>Box of wet matches.</German>
<Russian>Box of wet matches.</Russian>
</Key>
<Key ID="STR_EQUIP_CODE_NAME_41">
<Original>Blunt Hatchet</Original>
<English>Blunt Hatchet</English>
<German>Blunt Hatchet</German>
<Russian>Blunt Hatchet</Russian>
</Key>
<Key ID="STR_EQUIP_CODE_DESC_41">
<Original>Your Hatchet appears to be too bunt to be used.</Original>
<English>Your Hatchet appears to be too bunt to be used.</English>
<German>Your Hatchet appears to be too bunt to be used.</German>
<Russian>Your Hatchet appears to be too bunt to be used.</Russian>
</Key>
<Key ID="STR_EQUIP_CODE_NAME_4">
<Original>Blunt Knife</Original>
<English>Blunt Knife</English>
<German>Blunt Knife</German>
<Russian>Blunt Knife</Russian>
</Key>
<Key ID="STR_EQUIP_CODE_DESC_4">
<Original>Your Knife appears to be too bunt.</Original>
<English>Your Knife appears to be too bunt.</English>
<German>Your Knife appears to be too bunt.</German>
<Russian>Your Knife appears to be too bunt.</Russian>
</Key>
<Key ID="STR_FOOD_EQIP_CODE_NAME_1">
<Original>Mutton Raw</Original>
<English>Mutton Raw</English>
<German>Mutton Raw</German>
<Russian>Mutton Raw</Russian>
</Key>
<Key ID="STR_FOOD_EQUIP_CODE_DESC_1">
<Original>Goat Meat to be used for sustainment, must be cooked prior to eating.</Original>
<English>Goat Meat to be used for sustainment, must be cooked prior to eating.</English>
<German>Goat Meat to be used for sustainment, must be cooked prior to eating.</German>
<Russian>Goat Meat to be used for sustainment, must be cooked prior to eating.</Russian>
</Key>
<Key ID="STR_FOOD_EQIP_CODE_NAME_2">
<Original>Raw Chicken Leg</Original>
<English>Raw Chicken Leg</English>
<German>Raw Chicken Leg</German>
<Russian>Raw Chicken Leg</Russian>
</Key>
<Key ID="STR_FOOD_EQUIP_CODE_DESC_2">
<Original>Chicken Leg to be used for sustainment, must be cooked prior to eating.</Original>
<English>Chicken Leg to be used for sustainment, must be cooked prior to eating.</English>
<German>Chicken Leg to be used for sustainment, must be cooked prior to eating.</German>
<Russian>Chicken Leg to be used for sustainment, must be cooked prior to eating.</Russian>
</Key>
<Key ID="STR_FOOD_EQIP_CODE_NAME_3">
<Original>Rabbit Raw</Original>
<English>Rabbit Raw</English>
<German>Rabbit Raw</German>
<Russian>Rabbit Raw</Russian>
</Key>
<Key ID="STR_FOOD_EQUIP_CODE_DESC_3">
<Original>Rabbit to be used for sustainment, must be cooked prior to eating.</Original>
<English>Rabbit to be used for sustainment, must be cooked prior to eating.</English>
<German>Rabbit to be used for sustainment, must be cooked prior to eating.</German>
<Russian>Rabbit to be used for sustainment, must be cooked prior to eating.</Russian>
</Key>
<Key ID="STR_FOOD_EQIP_CODE_NAME_4">
<Original>Raw Bacon</Original>
<English>Raw Bacon</English>
<German>Raw Bacon</German>
<Russian>Raw Bacon</Russian>
</Key>
<Key ID="STR_FOOD_EQUIP_CODE_DESC_4">
<Original>Bacon to be used for sustainment, must be cooked prior to eating.</Original>
<English>Bacon to be used for sustainment, must be cooked prior to eating.</English>
<German>Bacon to be used for sustainment, must be cooked prior to eating.</German>
<Russian>Bacon to be used for sustainment, must be cooked prior to eating.</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQIP_CODE_NAME_1">
<Original>Cooked Mutton</Original>
<English>Cooked Mutton</English>
<German>Cooked Mutton</German>
<Russian>Cooked Mutton</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQUIP_CODE_DESC_1">
<Original>Goat Meat to be used for sustainment.</Original>
<English>Goat Meat to be used for sustainment.</English>
<German>Goat Meat to be used for sustainment.</German>
<Russian>Goat Meat to be used for sustainment.</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQIP_CODE_NAME_2">
<Original>Chicken Leg</Original>
<English>Chicken Leg</English>
<German>Chicken Leg</German>
<Russian>Chicken Leg</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQUIP_CODE_DESC_2">
<Original>Chicken Leg to be used for sustainment.</Original>
<English>Chicken Leg to be used for sustainment.</English>
<German>Chicken Leg to be used for sustainment.</German>
<Russian>Chicken Leg to be used for sustainment.</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQIP_CODE_NAME_3">
<Original>Rabbit</Original>
<English>Rabbit</English>
<German>Rabbit</German>
<Russian>Rabbit</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQUIP_CODE_DESC_3">
<Original>Rabbit to be used for sustainmen.</Original>
<English>Rabbit to be used for sustainment.</English>
<German>Rabbit to be used for sustainment.</German>
<Russian>Rabbit to be used for sustainment.</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQIP_CODE_NAME_4">
<Original>Bacon</Original>
<English>Bacon</English>
<German>Bacon</German>
<Russian>Bacon</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQUIP_CODE_DESC_4">
<Original>Bacon to be used for sustainment, must be cooked prior to eating.</Original>
<English>Bacon to be used for sustainment, must be cooked prior to eating.</English>
<German>Bacon to be used for sustainment, must be cooked prior to eating.</German>
<Russian>Bacon to be used for sustainment, must be cooked prior to eating.</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQIP_CODE_NAME_5">
<Original>Angel Cookies</Original>
<English>Angel Cookies</English>
<German>Angel Cookies</German>
<Russian>Angel Cookies</Russian>
</Key>
<Key ID="STR_FOODCOOKED_EQUIP_CODE_DESC_5">
<Original>Angel Cookies to boost your moral up!</Original>
<English>Angel Cookies to boost your moral up!</English>
<German>Angel Cookies to boost your moral up!</German>
<Russian>Angel Cookies to boost your moral up!</Russian>
</Key>
</Package>
</Project>

View File

@@ -285,11 +285,9 @@ class FSM
" _temp = round(player getVariable [""temperature"",100]);" \n
" _currentState = [_currentWpn,_currentAnim,_temp];" \n
" " \n
" //dayzCharDisco = [dayz_characterID,_playerPos,[weapons player,_magazineArray],[typeOf (unitbackpack player),getWeaponCargo (unitbackpack player),getMagazineCargo (unitbackpack player)],_medical,_currentState,_currentModel];" \n
" //[""dayzCharDisco"",[dayz_characterID,_playerPos,[weapons player,_magazineArray],[typeOf (unitbackpack player),getWeaponCargo (unitbackpack player),getMagazineCargo (unitbackpack player)],_medical,_currentState,_currentModel]] call callRpcProcedure;" \n
" //diag_log str(dayzCharDisco); " \n
"" \n
" //publicVariableServer ""dayzCharDisco"";" \n
" // remove isServer from player space" \n
" dayz_lastSave = time;" \n
" dayz_Magazines = [];" \n
"};"/*%FSM</ACTION""">*/;
@@ -425,12 +423,9 @@ class FSM
"" \n
"_msg = [];" \n
"" \n
"dayzLogin = [_playerUID,player];" \n
"[""dayzLogin"",[_playerUID,player]] call callRpcProcedure;" \n
"dayzPlayerLogin = [];" \n
"publicVariableServer ""dayzLogin"";" \n
"if (isServer) then {" \n
" dayzLogin call server_playerLogin;" \n
"};"/*%FSM</STATEINIT""">*/;
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
@@ -651,9 +646,7 @@ class FSM
"};" \n
"" \n
"dayzPlayerLogin2 = [];" \n
"dayzLogin2 = [_charID,player,_playerUID];" \n
"publicVariableServer ""dayzLogin2"";" \n
"// remove isServer from player space" \n
"[""dayzLogin2"",[_charID,player,_playerUID]] call callRpcProcedure;" \n
"" \n
"dayz_loadScreenMsg = ""Requesting Character data from server"";" \n
"progressLoadingScreen 0.8;" \n
@@ -1096,15 +1089,9 @@ class FSM
"" \n
"dayz_animalCheck = [] spawn player_spawn_1;" \n
"" \n
"dayz_lootCheck = [] spawn {" \n
"dayz_spawnCheck = [] spawn {" \n
" while {true} do {" \n
" [""Loot""] call player_spawnCheck;" \n
" sleep 10;" \n
" };" \n
"};" \n
"dayz_zedCheck = [] spawn {" \n
" while {true} do {" \n
" [""Zeds""] call player_spawnCheck; " \n
" [""both""] call player_spawnCheck;" \n
" sleep 8;" \n
" };" \n
"};" \n
@@ -1154,8 +1141,8 @@ class FSM
init = /*%FSM<STATEINIT""">*/"dayzGearSave = true;" \n
"dayz_myPosition = getPosATL player;" \n
"" \n
"dayzLoginRecord = [_playerUID,_charID,0];" \n
"publicVariableServer ""dayzLoginRecord"";"/*%FSM</STATEINIT""">*/;
"[""dayzLoginRecord"",[_playerUID,_charID,0]] call callRpcProcedure;" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{

View File

@@ -106,7 +106,7 @@ while {true} do {
//Has infection?
if (r_player_infected) then {
[player,"cough",8,false] call dayz_zombieSpeak;
[player,"cough",8,true] call dayz_zombieSpeak;
};
//Record Check
@@ -176,8 +176,9 @@ while {true} do {
//If has infection reduce blood
if (r_player_infected) then {
if (r_player_blood > 6000) then {
if (r_player_blood > 3000) then {
r_player_blood = r_player_blood - 3;
player setVariable["USEC_BloodQty",r_player_blood];
};
};
@@ -219,8 +220,7 @@ while {true} do {
if ((time - dayz_damageCounter) > 180) then {
if (!r_player_unconscious) then {
dayz_canDisconnect = true;
dayzDiscoRem = getPlayerUID player;
publicVariableServer "dayzDiscoRem";
["dayzDiscoRem",getPlayerUID player] call callRpcProcedure;
//Ensure Control is hidden
_display = uiNamespace getVariable 'DAYZ_GUI_display';
@@ -233,11 +233,8 @@ while {true} do {
//Save Checker
if (dayz_unsaved) then {
if ((time - dayz_lastSave) > _saveTime) then {
dayzPlayerSave = [player,dayz_Magazines,false];
publicVariableServer "dayzPlayerSave";
if (isServer) then {
dayzPlayerSave call server_playerSync;
};
["dayzPlayerSave",[player,dayz_Magazines,false]] call callRpcProcedure;
dayz_lastSave = time;
dayz_Magazines = [];
};

View File

@@ -0,0 +1,21 @@
/*
[_objectID,_objectUID] call server_deleteObj;
*/
private["_id","_uid","_key"];
_id = _this select 0;
_uid = _this select 1;
if (isServer) then {
//remove from database
if (parseNumber _id > 0) then {
//Send request
_key = format["CHILD:304:%1:",_id];
_key call server_hiveWrite;
diag_log format["DELETE: Deleted by ID: %1",_id];
} else {
//Send request
_key = format["CHILD:310:%1:",_uid];
_key call server_hiveWrite;
diag_log format["DELETE: Deleted by UID: %1",_uid];
};
};

View File

@@ -1,12 +1,33 @@
private ["_qty","_item","_meat","_loop","_timer"];
private["_item","_qty","_type","_meat","_loop"];
_item = _this select 0;
_qty = _this select 1;
_type = typeOf _item;
_meat = 0;
_loop = true;
if (local _item) then {
for "_x" from 1 to _qty do {
diag_log ("Item Type: " +str(_item));
switch (_type) do {
case "Cow": {
_item addMagazine "FoodSteakRaw";
};
case "Goat": {
_item addMagazine "FoodSteakRaw";
};
case "Sheep": {
_item addMagazine "FoodSteakRaw";
};
case "WildBoar": {
_item addMagazine "FoodboarRaw";
};
case "hen": {
_item addMagazine "FoodSteakRaw";
};
case "Rabbit": {
_item addMagazine "FoodSteakRaw";
};
};
};
sleep 2;
_timer = time;
while {_loop} do {
@@ -15,9 +36,11 @@ if (local _item) then {
if ((time - _timer) > 300) then {_loop = false};
sleep 1;
};
dayzHideBody = _item;
publicVariable "dayzHideBody";
hideBody _item;
["dayzHideBody",_item] call broadcastRpcCallAll;
sleep 10;
deleteVehicle _item;
} else {
_ehLoc = "client";
if (isServer) then { _ehLoc = "server"; };
diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_item)];
};

View File

@@ -0,0 +1,24 @@
private["_item","_qty","_type","_meat","_loop"];
_item = _this select 0;
_qty = _this select 1;
_type = typeOf _item;
_meat = 0;
_loop = true;
if (local _item) then {
_item addMagazine "ItemZombieParts";
sleep 2;
_timer = time;
while {_loop} do {
_meat = count magazines _item;
if (_meat == 0) then {_loop = false};
if ((time - _timer) > 300) then {_loop = false};
sleep 1;
};
["dayzHideBody",_item] call broadcastRpcCallAll;
sleep 10;
deleteVehicle _item;
} else {
_ehLoc = "client";
if (isServer) then { _ehLoc = "server"; };
diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_item)];
};

View File

@@ -12,8 +12,6 @@ if (count _this > 2) then {
dayz_players = dayz_players - [_this select 2];
};
//waitUntil{allowConnection};
//Variables
_inventory = [];
_backpack = [];
@@ -45,7 +43,7 @@ diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName);
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
_primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
_primary = _key call server_hiveReadWrite;
if (count _primary > 0) then {
if ((_primary select 0) != "ERROR") then {
_doLoop = 9;

View File

@@ -34,7 +34,7 @@ _state = [];
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:102:%1:",_characterID];
_primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
_primary = _key call server_hiveReadWrite;
if (count _primary > 0) then {
if ((_primary select 0) != "ERROR") then {
_doLoop = 9;
@@ -116,9 +116,7 @@ if (count _medical > 0) then {
//Add Wounds
{
_playerObj setVariable[_x,true,true];
[_playerObj,_x,_hit] spawn fnc_usec_damageBleed;
usecBleed = [_playerObj,_x,0];
publicVariable "usecBleed";
["usecBleed",[_playerObj,_x,_hit]] call broadcastRpcCallAll;
} forEach (_medical select 8);
//Add fractures

View File

@@ -4,10 +4,13 @@ private["_character","_magazines","_force","_characterID","_charPos","_isInVehic
//waituntil {(typeName(_this) == "ARRAY");sleep 0.01;}; //seems to cause often infinite waits (but not for first n players)
if ( typeName(_this) == "OBJECT" ) then {
//this only happens when we don't follow the correct parameter format...
//(like supplying just the player object instead of the array in player_eat.sqf)
//i've fixed this in player_eat so i can comment this part out
/*if ( typeName(_this) == "OBJECT" ) then {
_this = [_this,[],true];
//diag_log ("DW_DEBUG: #manual fix _this: " + str(_this));
};
};*/
//correct
//"UPDATE: [B 1-1-B:1 (THE BEAST) REMOTE,[],true]"

View File

@@ -1,7 +1,5 @@
private["_position","_num","_config","_itemType","_itemChance","_weights","_index","_iArray","_crashModel","_lootTable","_guaranteedLoot","_randomizedLoot","_frequency","_variance","_spawnChance","_spawnMarker","_spawnRadius","_spawnFire","_permanentFire","_crashName"];
waitUntil{!isNil "BIS_fnc_selectRandom"};
//_crashModel = _this select 0;
//_lootTable = _this select 1;
_guaranteedLoot = _this select 0;
@@ -78,9 +76,7 @@ while {true} do {
_crash setVariable ["ObjectID",1,true];
if (_spawnFire) then {
dayzFire = [_crash,2,time,false,_fadeFire];
publicVariable "dayzFire";
nul=dayzFire spawn BIS_Effects_Burn;
["dayzFire",[_crash,2,time,false,_fadeFire]] call broadcastRpcCallAll;
_crash setvariable ["fadeFire",_fadeFire,true];
};
@@ -92,8 +88,6 @@ while {true} do {
_weights = dayz_CBLChances select _index;
_cntWeights = count _weights;
waituntil {!isnil "fnc_buildWeightedArray"};
for "_x" from 1 to _num do {
//create loot
_index = floor(random _cntWeights);

8
dayz_server/config.cpp Normal file
View File

@@ -0,0 +1,8 @@
class CfgPatches {
class dayz_server {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"dayz_code"};
};
};

View File

@@ -0,0 +1,27 @@
//register client->server rpc
registerServerRpc = {
if (isServer) then {
_this call registerBroadcastRpc;
};
};
["dayzDeath", { (_this select 1) call server_playerDied; } ] call registerServerRpc;
["dayzDiscoAdd", { dayz_disco set [count dayz_disco,(_this select 1)]; } ] call registerServerRpc;
["dayzDiscoRem", { dayz_disco = dayz_disco - [(_this select 1)]; } ] call registerServerRpc;
["dayzPlayerSave", { (_this select 1) call server_playerSync; } ] call registerServerRpc;
["dayzPublishObj", { (_this select 1) call server_publishObj; } ] call registerServerRpc;
["dayzUpdateVehicle", { (_this select 1) call server_updateObject; } ] call registerServerRpc;
["dayzDeleteObj", { (_this select 1) call server_deleteObj; } ] call registerServerRpc;
["dayzLogin", { (_this select 1) call server_playerLogin; } ] call registerServerRpc;
["dayzLogin2", { (_this select 1) call server_playerSetup; } ] call registerServerRpc;
//missing sqf for server_playerMorph
//["dayzPlayerMorph", { (_this select 1) call server_playerMorph; } ] call registerServerRpc;
["dayzLoginRecord", { (_this select 1) call dayz_recordLogin; } ] call registerServerRpc;
["dayzCharDisco", { (_this select 1) call server_characterSync; } ] call registerServerRpc;
["dayzGutBody", { (_this select 1) spawn server_gutObject; } ] call registerServerRpc;
// DayZ Epoch Custom
["dayzGutBodyZ", { (_this select 1) spawn server_gutObjectZ; } ] call registerServerRpc;
["dayzPublishVeh", { (_this select 1) spawn server_publishVeh; } ] call registerServerRpc;
["dayzTradeObject", { (_this select 1) spawn server_tradeObj; } ] call registerServerRpc;
["dayzTraderMenu", { (_this select 1) spawn server_traders; } ] call registerServerRpc;

View File

@@ -7,21 +7,18 @@ BIS_MPF_remoteExecutionServer = {
};
BIS_Effects_Burn = {};
object_spawnDamVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_spawnDamVehicle.sqf";
server_playerLogin = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerLogin.sqf";
server_playerSetup = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSetup.sqf";
server_onPlayerDisconnect = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.sqf";
server_updateObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateObject.sqf";
server_playerDied = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDied.sqf";
server_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf";
server_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf"; //Creates the object in DB
server_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_deleteObj.sqf"; //Removes the object from the DB
server_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_gutObject.sqf"; //Generated on the server when gutting an object
server_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_gutObjectZ.sqf"; //Generated on the server when gutting an object
server_publishVeh = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle.sqf"; // Custom to add vehicles
server_tradeObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.sqf";
server_traders = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_traders.sqf";
local_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_publishObj.sqf"; //Creates the object in DB
local_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_deleteObj.sqf"; //Creates the object in DB
local_createObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_createObj.sqf"; //Creates the object in DB
server_playerSync = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSync.sqf";
zombie_findOwner = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\zombie_findOwner.sqf";
server_updateNearbyObjects = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateNearbyObjects.sqf";
@@ -63,7 +60,7 @@ check_publishobject = {
_allowed = true;
};
_allowed;
_allowed
};
//event Handlers
@@ -95,6 +92,23 @@ eh_localCleanup = {
}];
};
server_hiveWrite = {
private["_data"];
//diag_log ("ATTEMPT WRITE: " + _this);
_data = "HiveExt" callExtension _this;
diag_log ("WRITE: " + _data);
};
server_hiveReadWrite = {
private["_key","_resultArray","_data"];
_key = _this;
//diag_log ("ATTEMPT READ/WRITE: " + _key);
_data = "HiveExt" callExtension _key;
diag_log ("READ/WRITE: " + _data);
_resultArray = call compile format ["%1",_data];
_resultArray
};
server_characterSync = {
private ["_characterID","_playerPos","_playerGear","_playerBackp","_medical","_currentState","_currentModel","_key"];
_characterID = _this select 0;
@@ -110,28 +124,9 @@ server_characterSync = {
_key call server_hiveWrite;
};
//was missing for server
fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
//onPlayerConnected "[_uid,_name] spawn server_onPlayerConnect;";
onPlayerDisconnected "[_uid,_name] call server_onPlayerDisconnect;";
server_hiveWrite = {
private["_data"];
//diag_log ("ATTEMPT WRITE: " + _this);
_data = "HiveEXT" callExtension _this;
diag_log ("WRITE: " + _data);
};
server_hiveReadWrite = {
private["_key","_resultArray","_data"];
_key = _this select 0;
//diag_log ("ATTEMPT READ/WRITE: " + _key);
_data = "HiveEXT" callExtension _key;
diag_log ("READ/WRITE: " + _data);
_resultArray = call compile format ["%1;",_data];
_resultArray;
};
// Setup globals allow overwrite from init.sqf
if(isnil "dayz_MapArea") then {
@@ -144,38 +139,6 @@ if(isnil "HeliCrashArea") then {
HeliCrashArea = dayz_MapArea / 2;
};
spawn_heliCrash = {
private["_position","_veh","_config","_itemType","_itemTypes","_weights","_cntWeights","_index","_num","_i"];
_position = [getMarkerPos "center",0,HeliCrashArea,10,0,2000,0] call BIS_fnc_findSafePos;
_veh = createVehicle ["UH1Wreck_DZ",_position, [], 0, "CAN_COLLIDE"];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
_veh setVariable ["ObjectID",1,true];
dayzFire = [_veh,2,time,false,false];
publicVariable "dayzFire";
_config = configFile >> "CfgBuildingLoot" >> "HeliCrash";
_itemTypes = [] + getArray (_config >> "itemType");
_index = dayz_CBLCounts find (count _itemTypes);
_weights = dayz_CBLChances select _index;
_cntWeights = count _weights;
_num = round(random 4) + 3;
for "_i" from 1 to _num do {
//create loot
_index = floor(random _cntWeights);
_index = _weights select _index;
_itemType = _itemTypes select _index;
[_itemType select 0, _itemType select 1, _position, 5] call spawn_loot;
_nearby = _position nearObjects ["WeaponHolder", 5];
{
_x setVariable ["permaLoot",true];
} forEach _nearBy;
};
};
// Get all buildings and roads only once
MarkerPosition = getMarkerPos "center";
RoadList = MarkerPosition nearRoads DynamicVehicleArea;
@@ -462,6 +425,5 @@ dayz_objectUID2 = {
dayz_recordLogin = {
private["_key"];
_key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};

View File

@@ -251,16 +251,14 @@ class FSM
name = "sync_the_time";
init = /*%FSM<STATEINIT""">*/"//Send request" \n
"_key = ""CHILD:307:"";" \n
"_result = [_key] call server_hiveReadWrite;" \n
"_result = _key call server_hiveReadWrite;" \n
"_outcome = _result select 0;" \n
"if(_outcome == ""PASS"") then {" \n
" _date = _result select 1; " \n
" _dateNum = dateToNumber(_date); " \n
" _diff = ( _dateNum - dateToNumber (date) )*365*24*60;" \n
" if ( abs(_diff)>5 ) then {" \n
" setDate _date;" \n
" dayzSetDate = _date;" \n
" publicVariable ""dayzSetDate"";" \n
" [""dayzSetDate"",_date] call broadcastRpcCallAll;" \n
" diag_log (""TIME SYNC: Local Time set to "" + str(_date));" \n
" };" \n
"};" \n

View File

@@ -9,7 +9,7 @@ if ((count playableUnits == 0) and !isDedicated) then {
isSinglePlayer = true;
};
waitUntil{initialized};
waitUntil{initialized}; //means all the functions are now defined
diag_log "HIVE: Starting";
@@ -17,12 +17,11 @@ diag_log "HIVE: Starting";
/* STREAM OBJECTS */
//Send the key
_key = format["CHILD:302:%1:",dayZ_instance];
_data = "HiveEXT" callExtension _key;
_result = _key call server_hiveReadWrite;
diag_log "HIVE: Request sent";
//Process result
_result = call compile format ["%1",_data];
_status = _result select 0;
_myArray = [];
@@ -31,8 +30,7 @@ diag_log "HIVE: Starting";
//Stream Objects
diag_log ("HIVE: Commence Object Streaming...");
for "_i" from 1 to _val do {
_data = "HiveEXT" callExtension _key;
_result = call compile format ["%1",_data];
_result = _key call server_hiveReadWrite;
_status = _result select 0;
_myArray set [count _myArray,_result];
@@ -184,14 +182,12 @@ diag_log "HIVE: Starting";
//Set the Time
//Send request
_key = "CHILD:307:";
_result = [_key] call server_hiveReadWrite;
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if(_outcome == "PASS") then {
_date = _result select 1;
if(isDedicated) then {
setDate _date;
dayzSetDate = _date;
publicVariable "dayzSetDate";
["dayzSetDate",_date] call broadcastRpcCallAll;
};
diag_log ("HIVE: Local Time set to " + str(_date));
@@ -201,7 +197,6 @@ diag_log "HIVE: Starting";
if (isDedicated) then {
endLoadingScreen;
};
hiveInUse = false;
if (isDedicated) then {
_id = [] execFSM "\z\addons\dayz_server\system\server_cleanup.fsm";
@@ -242,7 +237,6 @@ for "_x" from 1 to MaxDynamicDebris do {
allowConnection = true;
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
nul = [3, 4, (50 * 60), (15 * 60), 0.75, 'center', 4000, true, false] spawn server_spawnCrashSite;