0.981 + 1.7.6.1 CE

+ Increased raise horde distance to 65m.
+ decreased raise horde action timer to 7 seconds.
+ sync with 1.7.6.1 CE
This commit is contained in:
vbawol
2013-02-26 20:05:35 -06:00
parent 52461f4a52
commit 3c9df28ead
319 changed files with 5267 additions and 1695 deletions

View File

@@ -60,7 +60,7 @@ if (!isDedicated) then {
zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf";
zombie_loiter = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_loiter.sqf"; //Server compile, used for loiter behaviour
zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviour
wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour
//
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
@@ -234,7 +234,7 @@ if (!isDedicated) then {
_dikCode = _this select 1;
_handled = false;
if (_dikCode in (actionKeys "GetOver")) then {
if (player isKindOf "PZombie_VB") exitWith {
//player action ["sitDown", player];
player switchAction "sitDown";
@@ -242,37 +242,21 @@ if (!isDedicated) then {
//player switchMove "AmovPercMstpSnonWnonDnon";
diag_log "Saved player zombie from animation lockup?";
};
DoRE = ({isPlayer _x} count (player nearEntities ["AllVehicles",500]) > 1);
if (canRoll && animationState player in ["amovpercmrunslowwrfldf","amovpercmrunsraswrfldf","amovpercmevaslowwrfldf","amovpercmevasraswrfldf"]) then {
canRoll = false;
null = [] spawn {
if (DoRE) then {
[nil, player, rSWITCHMOVE,"ActsPercMrunSlowWrflDf_FlipFlopPara"] call RE;
} else {
player switchMove "ActsPercMrunSlowWrflDf_FlipFlopPara";
};
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];
sleep 1;
canRoll = true;
if (!r_fracture_legs and (time - dayz_lastCheckBit > 4)) then {
_inBuilding = [player] call fnc_isInsideBuilding;
_nearbyObjects = nearestObjects[getPosATL player, ["TentStorage", "Hedgehog_DZ", "Sandbag1_DZ","TrapBear","Wire_cat1"], 8];
if (!_inBuilding and (count _nearbyObjects == 0)) then {
dayz_lastCheckBit = time;
call player_CombatRoll;
};
_handled = true;
};
};
//if (_dikCode == 57) then {_handled = true}; // space
//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
if ("ItemMap_Debug" in items player) then {
if (_dikCode == 88) then //SCROLL LOCK
if (_dikCode == 210) then //SCROLL LOCK
{
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
} else {
if (_dikCode == 70) then //SCROLL LOCK
{
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
};
if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
if (_dikCode in actionKeys "MoveRight") then {r_interrupt = true};
if (_dikCode in actionKeys "MoveForward") then {r_interrupt = true};
@@ -294,9 +278,11 @@ if (!isDedicated) then {
dayz_lastCheckBit = time;
[player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if ((_dikCode == 0x38 or _dikCode == 0xB8) and (time - dayz_lastCheckBit > 10)) then {
if (_dikCode in actionKeys "User20" and (time - dayz_lastCheckBit > 5)) then {
dayz_lastCheckBit = time;
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
call dayz_forceSave;
};
@@ -308,6 +294,25 @@ if (!isDedicated) then {
_handled
};
player_CombatRoll = {
DoRE = ({isPlayer _x} count (player nearEntities ["AllVehicles",100]) > 1);
if (canRoll && animationState player in ["amovpercmrunslowwrfldf","amovpercmrunsraswrfldf","amovpercmevaslowwrfldf","amovpercmevasraswrfldf"]) then {
canRoll = false;
null = [] spawn {
if (DoRE) then {
[nil, player, rSWITCHMOVE, "ActsPercMrunSlowWrflDf_FlipFlopPara"] call RE;
} else {
player switchMove "ActsPercMrunSlowWrflDf_FlipFlopPara";
};
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];
sleep 1;
canRoll = true;
};
_handled = true;
};
};
player_serverModelChange = {
private["_object","_model"];
_object = _this select 0;

View File

@@ -2,6 +2,58 @@ private["_holder","_type","_classname","_name"];
_holder = _this select 0;
_type = _this select 1;
_classname = _this select 2;
_name = getText (configFile >> _type >> _classname >> "displayName");
null = _holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
player reveal _holder;
actionMonitor = {
private["_holder","_type","_classname","_name","_action","_distance","_run","_timeout"];
_holder = _this select 0;
_type = _this select 1;
_classname = _this select 2;
_name = _this select 3;
_action = -1;
_distance = player distance _holder;
_run = true;
_timeout = 2;
while { _run } do {
if (alive _holder) then {
_distance = player distance _holder;
// Add action to player
if ((_distance < 1.75) and (_action == -1)) then {
_action = player addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
player reveal _holder;
_timeout = 0.3;
};
// Remove action from player
if ((_distance >= 1.75) and (_action != -1)) then {
player removeAction _action;
_action = -1;
_timeout = 2;
};
// Stop the loop and fall back to old code
if (_distance > 100) then {
null = _holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
player reveal _holder;
_run = false;
_timeout = 0;
};
} else {
if (_action != -1) then {
player removeAction _action;
_action = -1;
};
_timeout = 0;
_run = false;
};
sleep _timeout;
};
};
if (_classname == "WoodenArrow") then {
[_holder,_type,_classname,_name] spawn actionMonitor;
} else {
null = _holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true];
player reveal _holder;
};

View File

@@ -1,84 +1,62 @@
rpcCodeVarName = { format["%1_code",_this] };
rpcDirectCall = { call compile format["[%1,%2] call %3;",str(_this),_this,_this call rpcCodeVarName]; };
//Medical Event Handlers
"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"};
"norrnRDead" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\deadState.sqf"};
"usecBleed" addPublicVariableEventHandler {_id = (_this select 1) spawn fnc_usec_damageBleed};
"usecBandage" addPublicVariableEventHandler {(_this select 1) call player_medBandage};
"usecInject" addPublicVariableEventHandler {(_this select 1) call player_medInject};
"usecEpi" addPublicVariableEventHandler {(_this select 1) call player_medEpi};
"usecTransfuse" addPublicVariableEventHandler {(_this select 1) call player_medTransfuse};
"usecMorphine" addPublicVariableEventHandler {(_this select 1) call player_medMorphine};
"usecPainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller};
"dayzHit" addPublicVariableEventHandler {(_this select 1) call fnc_usec_damageHandler};
"dayzHitV" addPublicVariableEventHandler {(_this select 1) call fnc_usec_damageVehicle};
"dayzHideBody" addPublicVariableEventHandler {hideBody (_this select 1)};
"dayzGutBody" addPublicVariableEventHandler {(_this select 1) spawn local_gutObject};
"dayzGutBodyZ" addPublicVariableEventHandler {(_this select 1) spawn local_gutObjectZ};
"dayzDelLocal" addPublicVariableEventHandler {(_this select 1) call object_delLocal};
"dayzVehicleInit" addPublicVariableEventHandler {(_this select 1) call fnc_vehicleEventHandler};
"dayzHumanity" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
"dayz_serverObjectMonitor" addPublicVariableEventHandler {dayz_serverObjectMonitor = dayz_safety};
"usecBreakLegs" addPublicVariableEventHandler {(_this select 1) call player_breaklegs};
//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
};
//Both
//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 {
_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;
["dayzGutBody", { (_this select 1) call local_gutObject; } ] call registerBroadcastRpc;
["dayzGutBodyZ", { (_this select 1) call local_gutObjectZ; } ] 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;
["usecBreakLegs", { (_this select 1) call player_breaklegs; } ] call registerBroadcastRpc;
//server only
//Server only
if (isServer) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\publicEH_server.sqf";
"dayzDeath" addPublicVariableEventHandler {_id = (_this select 1) spawn server_playerDied};
"dayzDiscoAdd" addPublicVariableEventHandler {dayz_disco set [count dayz_disco,(_this select 1)];};
"dayzDiscoRem" addPublicVariableEventHandler {dayz_disco = dayz_disco - [(_this select 1)];};
"dayzPlayerSave" addPublicVariableEventHandler {_id = (_this select 1) spawn server_playerSync;};
"dayzPublishObj" addPublicVariableEventHandler {(_this select 1) call server_publishObj};
"dayzUpdateVehicle" addPublicVariableEventHandler {_id = (_this select 1) spawn server_updateObject};
"dayzLogin" addPublicVariableEventHandler {_id = (_this select 1) spawn server_playerLogin};
"dayzLogin2" addPublicVariableEventHandler {(_this select 1) call server_playerSetup};
"dayzPlayerMorph" addPublicVariableEventHandler {(_this select 1) call server_playerMorph};
"dayzUpdate" addPublicVariableEventHandler {_id = (_this select 1) spawn dayz_processUpdate};
"dayzLoginRecord" addPublicVariableEventHandler {_id = (_this select 1) spawn dayz_recordLogin};
"dayzCharSave" addPublicVariableEventHandler {_id = (_this select 1) spawn server_playerSync};
//Checking
"dayzSetFuel" addPublicVariableEventHandler {(_this select 1) spawn local_setFuel};
"dayzSetFix" addPublicVariableEventHandler {(_this select 1) call object_setFixServer};
"dayzDeleteObj" addPublicVariableEventHandler {(_this select 1) spawn server_deleteObj};
"atp" addPublicVariableEventHandler { _array = _this select 1; diag_log format["TELEPORT REVERT: %1 (%2) from %3 to %4 now at %5", _array select 0, _array select 1, _array select 2, _array select 3, _array select 4];};
// Dayz epoch custom
"dayzPublishVeh" addPublicVariableEventHandler {(_this select 1) spawn server_publishVeh};
"dayzTradeObject" addPublicVariableEventHandler {(_this select 1) spawn server_tradeObj};
"dayzTraderMenu" addPublicVariableEventHandler {(_this select 1) spawn server_traders};
"dayzPlayerDeaths" addPublicVariableEventHandler {(_this select 1) spawn server_deaths};
};
//clients only
//Client only
if (!isDedicated) then {
["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;
["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;
"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"};
"norrnRnoAnim" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\noAnim.sqf"};
"changeCharacter" addPublicVariableEventHandler {(_this select 1) call player_serverModelChange};
"dayzSwitch" addPublicVariableEventHandler {(_this select 1) call server_switchPlayer};
"dayzFire" addPublicVariableEventHandler {nul=(_this select 1) spawn BIS_Effects_Burn};
};

View File

@@ -49,10 +49,128 @@ pz_villager3 = "pz_villager3";
pz_priest = "pz_priest";
//Cooking
meatraw = ["FoodSteakRaw","FoodmeatRaw","FoodbeefRaw","FoodmuttonRaw","FoodchickenRaw","FoodrabbitRaw","FoodbaconRaw"];
meatcooked = ["FoodSteakCooked","FoodmeatCooked","FoodbeefCooked","FoodmuttonCooked","FoodchickenCooked","FoodrabbitCooked","FoodbaconCooked"];
meatraw = [
"FoodSteakRaw",
"FoodmeatRaw",
"FoodbeefRaw",
"FoodmuttonRaw",
"FoodchickenRaw",
"FoodrabbitRaw",
"FoodbaconRaw"
];
meatcooked = [
"FoodSteakCooked",
"FoodmeatCooked",
"FoodbeefCooked",
"FoodmuttonCooked",
"FoodchickenCooked",
"FoodrabbitCooked",
"FoodbaconCooked"
];
//Eating
no_output_food = ["FoodMRE", "FoodPistachio", "FoodNutmix","FoodBioMeat"]+meatcooked+meatraw;
badfood = ["FoodBioMeat"];
food_with_output=[
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"FoodCanGriff",
"FoodCanBadguy",
"FoodCanBoneboy",
"FoodCanCorn",
"FoodCanCurgon",
"FoodCanDemon",
"FoodCanFraggleos",
"FoodCanHerpy",
"FoodCanOrlok",
"FoodCanPowell",
"FoodCanTylers",
"FoodCanUnlabeled"
];
food_output = [
"TrashTinCan",
"TrashTinCan",
"TrashTinCan",
"TrashTinCan",
"FoodCanGriffEmpty",
"FoodCanBadguyEmpty",
"FoodCanBoneboyEmpty",
"FoodCanCornEmpty",
"FoodCanCurgonEmpty",
"FoodCanDemonEmpty",
"FoodCanFraggleosEmpty",
"FoodCanHerpyEmpty",
"FoodCanOrlokEmpty",
"FoodCanPowellEmpty",
"FoodCanTylersEmpty",
"FoodCanUnlabeledEmpty"
];
//Drinking
no_output_drink = ["ItemWaterbottle", "ItemWaterbottleBoiled"];
drink_with_output = [
"ItemSoda", //just to define item for ItemSodaEmpty
"ItemSodaCoke",
"ItemSodaPepsi",
"ItemSodaMdew",
"ItemSodaMtngreen",
"ItemSodaR4z0r",
"ItemSodaClays",
"ItemSodaSmasht",
"ItemSodaDrwaste",
"ItemSodaLemonade",
"ItemSodaLvg",
"ItemSodaMzly",
"ItemSodaRabbit"
];
drink_output = [
"ItemSodaEmpty",
"ItemSodaCokeEmpty",
"ItemSodaPepsiEmpty",
"ItemSodaMdewEmpty",
"ItemSodaMtngreenEmpty",
"ItemSodaR4z0rEmpty",
"ItemSodaClaysEmpty",
"ItemSodaSmashtEmpty",
"ItemSodaDrwasteEmpty",
"ItemSodaLemonadeEmpty",
"ItemSodaLvgEmpty",
"ItemSodaMzlyEmpty",
"ItemSodaRabbitEmpty"
];
boil_tin_cans = [
"TrashTinCan",
"FoodCanGriffEmpty",
"FoodCanBadguyEmpty",
"FoodCanBoneboyEmpty",
"FoodCanCornEmpty",
"FoodCanCurgonEmpty",
"FoodCanDemonEmpty",
"FoodCanFraggleosEmpty",
"FoodCanHerpyEmpty",
"FoodCanOrlokEmpty",
"FoodCanPowellEmpty",
"FoodCanTylersEmpty",
"FoodCanUnlabeledEmpty",
"ItemSodaEmpty",
"ItemSodaCokeEmpty",
"ItemSodaPepsiEmpty",
"ItemSodaMdewEmpty",
"ItemSodaMtngreenEmpty",
"ItemSodaR4z0rEmpty",
"ItemSodaClaysEmpty",
"ItemSodaSmashtEmpty",
"ItemSodaDrwasteEmpty",
"ItemSodaLemonadeEmpty",
"ItemSodaLvgEmpty",
"ItemSodaMzlyEmpty",
"ItemSodaRabbitEmpty"
];
dayz_combatLog = "";
canRoll = true;
@@ -260,7 +378,9 @@ dayzPlayerDeaths = [];
//DayZ settings
dayz_dawn = 6;
dayz_dusk = 18;
dayz_maxAnimals = 5;
if(isNil "dayz_maxAnimals") then {
dayz_maxAnimals = 5;
};
DAYZ_agentnumber = 0;
dayz_animalDistance = 800;
dayz_zSpawnDistance = 1000;
@@ -269,6 +389,15 @@ if(isNil "dayz_maxLocalZombies") then {
dayz_maxLocalZombies = 40;
};
if(isNil "dayz_maxGlobalZombies") then {
dayz_maxGlobalZombies = 30;
};
if(isNil "dayz_maxZeds") then {
dayz_maxZeds = 500;
};
dayz_spawnPos = getPosATL player;
//init global arrays for Loot Chances
@@ -355,6 +484,10 @@ if(!isDedicated) then {
dayz_lootDelay = 3;
dayz_lootWait = -300;
dayz_spawnZombies = 0;
//used to count global zeds around players
dayz_CurrentZombies = 0;
//Used to limit overall zed counts
dayz_maxCurrentZeds = 0;
dayz_inVehicle = false;
dayz_Magazines = [];
dayzGearSave = false;