mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Compiles.sqf cleanup
- Moved player_countMagazines to \compile\ folder - Removed several unused and obsolete files - Moved some epoch functions out of compiles.sqf into individual files - Synced order and formatting with 1.8.7. Much easier to compare now. Any changes I make to official DayZ Mod code and files I also submit as a pull request to them.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
- Optional news/rules feed on player login, set dayz_enableRules in init.sqf
|
||||
- Weapon switch hotkeys added (1 = primary, 2 = pistol, 3 = melee)
|
||||
- Journal is now functional for displaying stats
|
||||
- vehicle_handleDamage and vehicle_handleKilled have been renamed to fnc_veh_handleDam and fnc_veh_handleKilled respectively
|
||||
|
||||
[NEW] RedRyder BB Gun by @arma2WillRobinson
|
||||
[NEW] Added "RedRyder" and "350Rnd_BB_Magazine" to loot pile. #1456 #1457 @Namindu
|
||||
|
||||
@@ -10,12 +10,12 @@ class ItemToolbox : ItemCore
|
||||
class RemoveNet
|
||||
{
|
||||
text="Remove Camo Net";
|
||||
script="spawn player_removeNet;";
|
||||
script="[['DesertCamoNet_DZ','ForestCamoNet_DZ','DesertLargeCamoNet_DZ','ForestLargeCamoNet_DZ'],5,'str_epoch_player_8'] call player_removeNearby;";
|
||||
};
|
||||
class RemoveTankTrap
|
||||
{
|
||||
text="Remove Tank Trap";
|
||||
script="spawn player_removeTankTrap;";
|
||||
script="[['Hedgehog_DZ'],1,'STR_EPOCH_ACTIONS_14'] call player_removeNearby;";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -21,14 +21,6 @@ REMOVE TOOL BREAKING, IT'S STUPID
|
||||
|
||||
player_craftItem_DZV = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
|
||||
|
||||
vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
|
||||
vehicle_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
|
||||
|
||||
ARE NO MORE, USE BELOW!! ACTUALLY IT MAY BE EASIER TO JUST RENAME THE BELOW TO ABOVE?
|
||||
|
||||
fnc_veh_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleDam.sqf";
|
||||
fnc_veh_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleKilled.sqf";
|
||||
|
||||
dayz_serverObjectMonitor = []; IS REPLACED WITH PVDZE_serverObjectMonitor = [];
|
||||
PVDZ_obj_Publish IS PVDZE_obj_Publish
|
||||
******REPLACE ALL PVCDZ_ AND PVDZ_ with PVCDZE/PVDZE_
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
private ["_vehicle","_class","_maxMagazines","_maxWeapons","_maxBackpacks","_magazineCount","_weaponsCount","_backpackCount","_magazineCount_raw","_weaponsCount_raw","_backpackCount_raw"];
|
||||
private ["_vehicle","_class","_maxMagazines","_maxWeapons","_maxBackpacks","_magazineCount","_weaponsCount","_backpackCount","_magazineCount_raw","_weaponsCount_raw","_backpackCount_raw","_vehicle_gear_count"];
|
||||
_vehicle = _this select 3;
|
||||
|
||||
_class = typeOf _vehicle;
|
||||
|
||||
_vehicle_gear_count = {
|
||||
private "_counter";
|
||||
_counter = 0;
|
||||
{
|
||||
_counter = _counter + _x;
|
||||
} count _this;
|
||||
_counter
|
||||
};
|
||||
|
||||
// Get max magazines count
|
||||
_maxMagazines = getNumber (configFile >> "CfgVehicles" >> _class >> "transportMaxMagazines");
|
||||
|
||||
@@ -12,22 +20,22 @@ _maxWeapons = getNumber (configFile >> "CfgVehicles" >> _class >> "transportMaxW
|
||||
// Get max backpack count
|
||||
_maxBackpacks = getNumber (configFile >> "CfgVehicles" >> _class >> "transportmaxbackpacks");
|
||||
|
||||
// Count && show magazines available space
|
||||
// Count and show magazines available space
|
||||
_magazineCount_raw = getMagazineCargo _vehicle;
|
||||
|
||||
// Count && show weapons available space
|
||||
// Count and show weapons available space
|
||||
_weaponsCount_raw = getWeaponCargo _vehicle;
|
||||
|
||||
// Count && show backpacks available space
|
||||
// Count and show backpacks available space
|
||||
_backpackCount_raw = getBackpackCargo _vehicle;
|
||||
|
||||
// Count && show magazines available space
|
||||
_magazineCount = (_magazineCount_raw select 1) call vehicle_gear_count;
|
||||
// Count and show magazines available space
|
||||
_magazineCount = (_magazineCount_raw select 1) call _vehicle_gear_count;
|
||||
|
||||
// Count && show weapons available space
|
||||
_weaponsCount = (_weaponsCount_raw select 1) call vehicle_gear_count;
|
||||
// Count and show weapons available space
|
||||
_weaponsCount = (_weaponsCount_raw select 1) call _vehicle_gear_count;
|
||||
|
||||
// Count && show weapons available space
|
||||
_backpackCount = (_backpackCount_raw select 1) call vehicle_gear_count;
|
||||
// Count and show weapons available space
|
||||
_backpackCount = (_backpackCount_raw select 1) call _vehicle_gear_count;
|
||||
|
||||
cutText [format[(localize "str_epoch_player_1"),_magazineCount,_maxMagazines,_weaponsCount,_maxWeapons,_backpackCount,_maxBackpacks], "PLAIN DOWN"];
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
count player magazines with ammo count
|
||||
value = call player_countMagazines; //must be called from a spawned thread (|| use spawn)
|
||||
return all player magazines with ammo count
|
||||
Modified to save backpack magazine count by icomrade - Base for fix by Ziellos2k
|
||||
*/
|
||||
private ["_control","_item","_val","_max","_count","_magazineArray","_dialog"];
|
||||
disableSerialization;
|
||||
|
||||
_magazineArray = [[],[]];
|
||||
_dialog = ["0"] call gearDialog_create;
|
||||
if ((isNull _dialog) || (isNil "_dialog")) exitWith {disableUserInput false; (findDisplay 106) closeDisplay 0; closeDialog 0; _magazineArray};
|
||||
|
||||
//Main inventory
|
||||
for "_i" from 109 to 120 do {
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
(_magazineArray select 0) set [count (_magazineArray select 0),[_item,_val]];
|
||||
} else {
|
||||
(_magazineArray select 0) set [count (_magazineArray select 0),_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Pistol/secondary ammo
|
||||
for "_i" from 122 to 129 do {
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
(_magazineArray select 0) set [count (_magazineArray select 0),[_item,_val]];
|
||||
} else {
|
||||
(_magazineArray select 0) set [count (_magazineArray select 0),_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//backpack items
|
||||
if ((typeOf (unitBackPack player)) != "") then {
|
||||
_count = getNumber (configFile >> "CfgVehicles" >> (typeOf (unitBackpack Player)) >> "transportMaxMagazines");
|
||||
ctrlActivate (_dialog displayCtrl 157);
|
||||
if (gear_done) then {
|
||||
waitUntil {ctrlShown (_dialog displayCtrl 159)};
|
||||
uiSleep 0.001;
|
||||
};
|
||||
|
||||
for "_i" from 5000 to (5000 + _count) do {
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
(_magazineArray select 1) set [count (_magazineArray select 1),[_item,_val]];
|
||||
} else {
|
||||
(_magazineArray select 1) set [count (_magazineArray select 1),_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
(findDisplay 106) closeDisplay 0;
|
||||
if (gear_done) then {uiSleep 0.001;};
|
||||
_magazineArray
|
||||
@@ -1,88 +0,0 @@
|
||||
private ["_onLadder","_itemorignal","_hasdrinkitem","_hasoutput","_config","_text","_sfx","_dis","_itemtodrop","_nearByPile","_item","_display","_invehicle"];
|
||||
|
||||
disableserialization;
|
||||
call gear_ui_init;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
//if (vehicle player != player) exitWith {cutText ["\n\nYou may not drink while in a vehicle", "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"]};
|
||||
|
||||
_itemorignal = _this;
|
||||
_hasdrinkitem = _itemorignal in magazines player;
|
||||
_hasoutput = _itemorignal in drink_with_output;
|
||||
_invehicle = false;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _itemorignal;
|
||||
_text = getText (_config >> "displayName");
|
||||
|
||||
//getting type of sfx (now just drink od soda open && drink)
|
||||
_sfx = getText (_config >> "sfx");
|
||||
|
||||
if (!_hasdrinkitem) exitWith {cutText [format[(localize "str_player_31"),_text,"drink"] , "PLAIN DOWN"]};
|
||||
|
||||
player playActionNow "PutDown";
|
||||
player removeMagazine _itemorignal;
|
||||
if (vehicle player != player) then {
|
||||
_display = findDisplay 106;
|
||||
_display closeDisplay 0;
|
||||
_invehicle = true;
|
||||
};
|
||||
|
||||
uiSleep 1;
|
||||
|
||||
if (["ItemWaterbottle",_itemorignal] call fnc_inString) then {
|
||||
//low alert && sound radius
|
||||
_dis=5;
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
player addMagazine "ItemWaterbottleUnfilled";
|
||||
};
|
||||
if (["ItemSoda",_itemorignal] call fnc_inString) then {
|
||||
//higher alert && sound radius
|
||||
_dis=10;
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
};
|
||||
|
||||
if (_hasoutput) then {
|
||||
// Selecting output
|
||||
_itemtodrop = drink_output select (drink_with_output find _itemorignal);
|
||||
|
||||
if (!_invehicle) then {
|
||||
uiSleep 3;
|
||||
_nearByPile = nearestObjects [(getPosATL player), ["WeaponHolder","WeaponHolderBase"],2];
|
||||
if (count _nearByPile == 0) then {
|
||||
_iPos = getPosATL player;
|
||||
_radius = 0.0;
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item setPosATL _iPos;
|
||||
} else {
|
||||
_item = _nearByPile select 0;
|
||||
};
|
||||
_item addMagazineCargoGlobal [_itemtodrop,1];
|
||||
} else {
|
||||
uiSleep 2;
|
||||
(vehicle player) addMagazineCargoGlobal [_itemtodrop,1];
|
||||
};
|
||||
};
|
||||
|
||||
//add infection chance for "ItemWaterbottle",
|
||||
if ((random 15 < 1) && (_itemorignal == "ItemWaterbottle")) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
|
||||
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
|
||||
|
||||
dayz_lastDrink = time;
|
||||
dayz_thirst = 0;
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
(_display displayCtrl 1302) ctrlShow true;
|
||||
|
||||
cutText [format[(localize "str_player_consumed"),_text], "PLAIN DOWN"];
|
||||
@@ -1,106 +0,0 @@
|
||||
private ["_onLadder","_itemorignal","_hasfooditem","_rawfood","_hasoutput","_config","_text","_regen","_dis","_sfx","_itemtodrop","_nearByPile","_item","_display","_rawexceptions","_badfood","_invehicle"];
|
||||
disableserialization;
|
||||
call gear_ui_init;
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
//if (vehicle player != player) exitWith {cutText ["\n\nYou may not eat while in a vehicle", "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"]};
|
||||
|
||||
_itemorignal = _this;
|
||||
_hasfooditem = _itemorignal in magazines player;
|
||||
|
||||
_rawfood = _itemorignal in meatraw;
|
||||
_rawexceptions = _itemorignal in exceptionsraw;
|
||||
//_cookedfood = _itemorignal in meatcooked;
|
||||
_hasoutput = _itemorignal in food_with_output;
|
||||
|
||||
_badfood = _itemorignal in badfood;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _itemorignal;
|
||||
_text = getText (_config >> "displayName");
|
||||
_regen = getNumber (_config >> "bloodRegen");
|
||||
|
||||
if (!_hasfooditem) exitWith {cutText [format[(localize "str_player_31"),_text,"consume"] , "PLAIN DOWN"]};
|
||||
|
||||
player playActionNow "PutDown";
|
||||
player removeMagazine _itemorignal;
|
||||
|
||||
_invehicle = false;
|
||||
if (vehicle player != player) then {
|
||||
_display = findDisplay 106;
|
||||
_display closeDisplay 0;
|
||||
_invehicle = true;
|
||||
};
|
||||
|
||||
uiSleep 1;
|
||||
|
||||
_dis=6;
|
||||
_sfx = "eat";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
if (dayz_lastMeal < 3600) then {
|
||||
if (_itemorignal == "FoodSteakCooked") then {
|
||||
//_regen = _regen * (10 - (10 max ((time - _Cookedtime) / 3600)));
|
||||
};
|
||||
};
|
||||
|
||||
if (_hasoutput) then {
|
||||
// Selecting output
|
||||
_itemtodrop = food_output select (food_with_output find _itemorignal);
|
||||
|
||||
if (!_invehicle) then {
|
||||
uiSleep 3;
|
||||
_nearByPile = nearestObjects [(getPosATL player), ["WeaponHolder","WeaponHolderBase"],2];
|
||||
if (count _nearByPile == 0) then {
|
||||
_iPos = getPosATL player;
|
||||
_radius = 0.0;
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item setPosATL _iPos;
|
||||
} else {
|
||||
_item = _nearByPile select 0;
|
||||
};
|
||||
_item addMagazineCargoGlobal [_itemtodrop,1];
|
||||
} else {
|
||||
uiSleep 2;
|
||||
(vehicle player) addMagazineCargoGlobal [_itemtodrop,1];
|
||||
};
|
||||
};
|
||||
|
||||
if (_rawfood && !_rawexceptions && (random 15 < 1)) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
|
||||
if (_badfood && (random 2 < 1)) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
|
||||
r_player_blood = r_player_blood + _regen;
|
||||
if (r_player_blood > r_player_bloodTotal) then {
|
||||
r_player_blood = r_player_bloodTotal;
|
||||
};
|
||||
|
||||
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
|
||||
player setVariable["USEC_BloodQty",r_player_blood,true];
|
||||
player setVariable["medForceUpdate",true];
|
||||
|
||||
//["PVDZE_plr_Save",[player,[],true]] call callRpcProcedure;
|
||||
PVDZE_plr_Save = [player,[],true,true];
|
||||
publicVariableServer "PVDZE_plr_Save";
|
||||
|
||||
dayz_lastMeal = time;
|
||||
dayz_hunger = 0;
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
(_display displayCtrl 1301) ctrlShow true;
|
||||
|
||||
if (r_player_blood / r_player_bloodTotal >= 0.2) then {
|
||||
(_display displayCtrl 1300) ctrlShow true;
|
||||
};
|
||||
cutText [format[(localize "str_player_consumed"),_text], "PLAIN DOWN"];
|
||||
@@ -1,25 +1,15 @@
|
||||
private ["_object"];
|
||||
private ["_object","_position"];
|
||||
_object = _this select 3;
|
||||
|
||||
// _position = [position _object,0,0,0,0,0,0,position player] call BIS_fnc_findSafePos;
|
||||
|
||||
//Standup
|
||||
//player playMove "amovpercmstpsraswrfldnon_amovpknlmstpslowwrfldnon";
|
||||
//uiSleep 1;
|
||||
//waitUntil { animationState player != "amovpercmstpsraswrfldnon_amovpknlmstpslowwrfldnon"};
|
||||
|
||||
//Kneel Down
|
||||
player playMove "amovpknlmstpslowwrfldnon_amovpercmstpsraswrfldnon";
|
||||
waitUntil { animationState player != "amovpknlmstpslowwrfldnon_amovpercmstpsraswrfldnon"};
|
||||
uiSleep 2;
|
||||
|
||||
//_object setpos _position;
|
||||
_object setvectorup [0,0,1];
|
||||
//[player,"scream",0,true] call dayz_zombieSpeak;
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
// Alert Zombies
|
||||
[player,20,true,(getPosATL player)] call player_alertZombies;
|
||||
|
||||
// Added Nutrition-Factor for work
|
||||
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
|
||||
uiSleep 3;
|
||||
|
||||
|
||||
//Other possibilities
|
||||
//[_object,0, 0] call bis_fnc_setpitchbank;
|
||||
//_object setpos [getpos _object select 0, getpos _object select 1, 0];
|
||||
@@ -1,71 +0,0 @@
|
||||
private ["_location","_isOk","_pondPos","_isPond","_dir","_dis","_sfx","_classname","_object","_playerPos","_item","_hastentitem","_building","_config","_text","_objectsPond"];
|
||||
//check if can pitch here
|
||||
call gear_ui_init;
|
||||
_playerPos = getPosATL player;
|
||||
_item = _this;
|
||||
_hastentitem = _this in magazines player;
|
||||
_location = player modeltoworld [0,2.5,0];
|
||||
_location set [2,0];
|
||||
_building = nearestObject [(vehicle player), "HouseBase"];
|
||||
_isOk = [(vehicle player),_building] call fnc_isInsideBuilding;
|
||||
//_isOk = true;
|
||||
|
||||
//diag_log ("Pitch Tent: " + str(_isok) );
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
_text = getText (_config >> "displayName");
|
||||
|
||||
if (!_hastentitem) exitWith {cutText [format[(localize "str_player_31"),_text,"pitch"] , "PLAIN DOWN"]};
|
||||
|
||||
//blocked
|
||||
if (["concrete",dayz_surfaceType] call fnc_inString) then { _isOk = true; diag_log ("surface concrete"); };
|
||||
//Block Tents in pounds
|
||||
_objectsPond = nearestObjects [_playerPos, [], 10];
|
||||
{
|
||||
_isPond = ["pond",str(_x),false] call fnc_inString;
|
||||
if (_isPond) then {
|
||||
_pondPos = (_x worldToModel _playerPos) select 2;
|
||||
if (_pondPos < 0) then {
|
||||
_isOk = true;
|
||||
};
|
||||
};
|
||||
} count _objectsPond;
|
||||
|
||||
//diag_log ("Pitch Tent: " + str(_isok) );
|
||||
|
||||
if (!_isOk) then {
|
||||
//remove tentbag
|
||||
player removeMagazine _item;
|
||||
_dir = round(direction player);
|
||||
|
||||
[1,1] call dayz_HungerThirst;
|
||||
//wait a bit
|
||||
player playActionNow "Medic";
|
||||
uiSleep 1;
|
||||
|
||||
_dis=20;
|
||||
_sfx = "tentunpack";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Pitch" >> "create");
|
||||
|
||||
uiSleep 5;
|
||||
//place tent (local)
|
||||
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_object setdir _dir;
|
||||
_object setpos _location;
|
||||
player reveal _object;
|
||||
_location = getPosATL _object;
|
||||
|
||||
_object setVariable ["CharacterID",dayz_characterID,true];
|
||||
|
||||
//["PVDZE_obj_Publish",[dayz_characterID,_tent,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
PVDZE_obj_Publish = [dayz_characterID,_object,[_dir,_location],_classname];
|
||||
publicVariableServer "PVDZE_obj_Publish";
|
||||
|
||||
cutText [localize "str_success_tent_pitch", "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [localize "str_fail_tent_pitch", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
12
SQF/dayz_code/compile/dze_ejectPlayer.sqf
Normal file
12
SQF/dayz_code/compile/dze_ejectPlayer.sqf
Normal file
@@ -0,0 +1,12 @@
|
||||
// check if player in vehicle
|
||||
private ["_noDriver","_vehicle","_inVehicle"];
|
||||
|
||||
_vehicle = vehicle player;
|
||||
_inVehicle = (_vehicle != player);
|
||||
|
||||
if(_inVehicle) then {
|
||||
_noDriver = ((_vehicle emptyPositions "driver") > 0);
|
||||
if (_noDriver && (speed _vehicle) != 0) then {
|
||||
player action [ "eject", _vehicle];
|
||||
};
|
||||
};
|
||||
15
SQF/dayz_code/compile/dze_getModelName.sqf
Normal file
15
SQF/dayz_code/compile/dze_getModelName.sqf
Normal file
@@ -0,0 +1,15 @@
|
||||
_objInfo = toArray(str(_this));
|
||||
_lenInfo = count _objInfo - 1;
|
||||
_objName = [];
|
||||
_i = 0;
|
||||
// determine where the object name starts
|
||||
{
|
||||
if (58 == _objInfo select _i) exitWith {};
|
||||
_i = _i + 1;
|
||||
} count _objInfo;
|
||||
_i = _i + 2; // skip the ": " part
|
||||
for "_k" from _i to _lenInfo do {
|
||||
_objName set [(count _objName), (_objInfo select _k)];
|
||||
};
|
||||
_objName = toLower(toString(_objName));
|
||||
_objName
|
||||
18
SQF/dayz_code/compile/dze_isNearestPlayer.sqf
Normal file
18
SQF/dayz_code/compile/dze_isNearestPlayer.sqf
Normal file
@@ -0,0 +1,18 @@
|
||||
private ["_notClosest","_playerDistance","_nearPlayers","_obj","_playerNear"];
|
||||
|
||||
if (!isNull _this) then {
|
||||
_nearPlayers = _this nearEntities ["CAManBase", 12];
|
||||
_playerNear = ({isPlayer _x} count _nearPlayers) > 1;
|
||||
_notClosest = false;
|
||||
if (_playerNear) then {
|
||||
// check if another player is closer
|
||||
_playerDistance = player distance _this;
|
||||
{
|
||||
if (_playerDistance > (_x distance _this)) exitWith { _notClosest = true; };
|
||||
} count _nearPlayers;
|
||||
};
|
||||
} else {
|
||||
_notClosest = false;
|
||||
};
|
||||
|
||||
_notClosest
|
||||
13
SQF/dayz_code/compile/epoch_itemCost.sqf
Normal file
13
SQF/dayz_code/compile/epoch_itemCost.sqf
Normal file
@@ -0,0 +1,13 @@
|
||||
_trade_total = 0;
|
||||
{
|
||||
_part_in_configClass = configFile >> "CfgMagazines" >> (_x select 0);
|
||||
if (isClass (_part_in_configClass)) then {
|
||||
_part_inWorth = (_part_in_configClass >> "worth");
|
||||
if isNumber (_part_inWorth) then {
|
||||
_trade_total = _trade_total + (getNumber(_part_inWorth) * (_x select 1));
|
||||
};
|
||||
};
|
||||
} count _this;
|
||||
|
||||
//diag_log format["DEBUG TRADER ITEMCOST: %1", _this];
|
||||
_trade_total
|
||||
@@ -1,4 +1,5 @@
|
||||
// Made for DayZ Epoch by vbawol
|
||||
// usage [["partinclassname",4]] call epoch_returnChange;
|
||||
|
||||
private ["_trade_total","_part_inWorth","_part_in_configClass","_total_currency","_part","_worth","_return_change","_total","_briefcase_100oz","_gold_10oz_a","_gold_10oz_b","_gold_10oz","_gold_1oz_a","_gold_1oz_b","_gold_1oz","_silver_10oz_a","_silver_10oz_b","_silver_10oz","_silver_1oz_a","_silver_1oz_b","_silver_1oz","_successful","_buyOrSell","_total_items"];
|
||||
_successful = false;
|
||||
|
||||
14
SQF/dayz_code/compile/epoch_tempKeys.sqf
Normal file
14
SQF/dayz_code/compile/epoch_tempKeys.sqf
Normal file
@@ -0,0 +1,14 @@
|
||||
private ["_temp_keys","_temp_keys_names","_key_colors","_ownerKeyId","_ownerKeyName"];
|
||||
_temp_keys = [];
|
||||
_temp_keys_names = [];
|
||||
// find available keys
|
||||
_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
|
||||
{
|
||||
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
|
||||
_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
|
||||
_ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
|
||||
_temp_keys_names set [_ownerKeyId,_ownerKeyName];
|
||||
_temp_keys set [count _temp_keys,str(_ownerKeyId)];
|
||||
};
|
||||
} count (items player);
|
||||
[_temp_keys,_temp_keys_names]
|
||||
10
SQF/dayz_code/compile/epoch_totalCurrency.sqf
Normal file
10
SQF/dayz_code/compile/epoch_totalCurrency.sqf
Normal file
@@ -0,0 +1,10 @@
|
||||
// total currency
|
||||
_total_currency = 0;
|
||||
{
|
||||
_part = (configFile >> "CfgMagazines" >> _x);
|
||||
_worth = (_part >> "worth");
|
||||
if isNumber (_worth) then {
|
||||
_total_currency = _total_currency + getNumber(_worth);
|
||||
};
|
||||
} count (magazines player);
|
||||
_total_currency
|
||||
7
SQF/dayz_code/compile/fn_checkAndRemoveItems.sqf
Normal file
7
SQF/dayz_code/compile/fn_checkAndRemoveItems.sqf
Normal file
@@ -0,0 +1,7 @@
|
||||
private ["_items","_b"];
|
||||
_items = _this;
|
||||
_b = _items call player_checkItems;
|
||||
if (_b) then {
|
||||
_b = _items call player_removeItems;
|
||||
};
|
||||
_b
|
||||
@@ -1,21 +0,0 @@
|
||||
scriptName "Functions\misc\fn_damageHandler.sqf";
|
||||
/***********************************************************
|
||||
PROCESS DAMAGE TO A UNIT
|
||||
- Function
|
||||
- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
|
||||
************************************************************/
|
||||
private ["_unit","_hit","_damage","_total"];
|
||||
_unit = _this select 0;
|
||||
_hit = _this select 1;
|
||||
_damage = _this select 2;
|
||||
//_source = _this select 3;
|
||||
//_ammo = _this select 4;
|
||||
|
||||
_total = _damage;
|
||||
|
||||
//diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit));
|
||||
|
||||
if (local _unit) then {
|
||||
_total = [_unit,_hit,_damage] call object_setHitServer;
|
||||
};
|
||||
_total
|
||||
@@ -1,35 +0,0 @@
|
||||
private ["_unit1","_building","_relPos","_boundingBox","_min","_max","_myX","_myY","_myZ","_inside"];
|
||||
_unit1 = _this select 0;
|
||||
_building = _this select 1;
|
||||
|
||||
//_type = typeOf _building;
|
||||
_relPos = _building worldToModel _unit1;
|
||||
_boundingBox = boundingBox _building;
|
||||
//diag_log ("DEBUG: Building: " + str(_building) );
|
||||
//diag_log ("DEBUG: Building Type: " + str(_type) );
|
||||
//diag_log ("DEBUG: BoundingBox: " + str(_boundingBox) );
|
||||
|
||||
_min = _boundingBox select 0;
|
||||
_max = _boundingBox select 1;
|
||||
|
||||
//diag_log ("Min: " + str(_min) );
|
||||
//diag_log ("Max: " + str(_max) );
|
||||
|
||||
_myX = _relPos select 0;
|
||||
_myY = _relPos select 1;
|
||||
_myZ = _relPos select 2;
|
||||
|
||||
//diag_log ("X: " + str(_myX) );
|
||||
//diag_log ("Y: " + str(_myY) );
|
||||
//diag_log ("Z: " + str(_myZ) );
|
||||
|
||||
if ((_myX > (_min select 0)) && (_myX < (_max select 0))) then {
|
||||
if ((_myY > (_min select 1)) && (_myY < (_max select 1))) then {
|
||||
if ((_myZ > (_min select 2)) && (_myZ < (_max select 2))) then {
|
||||
_inside = true;
|
||||
} else { _inside = false; };
|
||||
} else { _inside = false; };
|
||||
} else { _inside = false; };
|
||||
|
||||
//diag_log ("isinBuilding Check: " + str(_inside) );
|
||||
_inside
|
||||
@@ -1,10 +1,10 @@
|
||||
/*
|
||||
Description:
|
||||
Removes the items (magazines) from the player's inventory
|
||||
&& performs a double check for the required items.
|
||||
and performs a double check for the required items.
|
||||
|
||||
Parameter(s):
|
||||
_this: <array> list of item names to be removed (can also be an sub-array with item name && quantity)
|
||||
_this: <array> list of item names to be removed (can also be an sub-array with item name and quantity)
|
||||
|
||||
Returns:
|
||||
Boolean (true if all items have been removed from the player's inventory)
|
||||
|
||||
16
SQF/dayz_code/compile/fnc_getPlayerUID.sqf
Normal file
16
SQF/dayz_code/compile/fnc_getPlayerUID.sqf
Normal file
@@ -0,0 +1,16 @@
|
||||
private ["_object","_version","_PID"];
|
||||
|
||||
_object = _this select 0;
|
||||
_version = productVersion select 3;
|
||||
if (DayZ_UseSteamID) then {
|
||||
_PID = GetPlayerUID _object;
|
||||
} else {
|
||||
if (_version >= 125548) then {
|
||||
_PID = call (compile "GetPlayerUIDOld _object");
|
||||
} else {
|
||||
_PID = GetPlayerUID _object;
|
||||
diag_log format["Your game version, %1, is less than the required for the old UID system; using Steam ID system instead. Update to 1.63.125548 (or latest steam beta)", _version];
|
||||
};
|
||||
};
|
||||
|
||||
_PID
|
||||
11
SQF/dayz_code/compile/fnc_getPos.sqf
Normal file
11
SQF/dayz_code/compile/fnc_getPos.sqf
Normal file
@@ -0,0 +1,11 @@
|
||||
private "_pos";
|
||||
|
||||
if (isNil {_this select 0}) exitWith {[0,0,0]};
|
||||
_thingy = _this select 0;
|
||||
_pos = getPosASL _thingy;
|
||||
|
||||
if !(surfaceIsWater _pos) then {
|
||||
_pos = ASLToATL _pos;
|
||||
};
|
||||
|
||||
_pos
|
||||
11
SQF/dayz_code/compile/fnc_getSetPos.sqf
Normal file
11
SQF/dayz_code/compile/fnc_getSetPos.sqf
Normal file
@@ -0,0 +1,11 @@
|
||||
//DO NOT USE IF YOU NEED ANGLE COMPENSATION!!!!
|
||||
private "_pos";
|
||||
|
||||
_thingy = _this select 0;
|
||||
_pos = getPosASL _thingy;
|
||||
|
||||
if (surfaceIsWater _pos) then {
|
||||
_thingy setPosASL _pos;
|
||||
} else {
|
||||
_thingy setPosATL (ASLToATL _pos);
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
private ["_spawnveh","_position","_direction","_veh"];
|
||||
{
|
||||
_spawnveh = _x select 0;
|
||||
_position = _x select 1;
|
||||
_direction = _x select 2;
|
||||
|
||||
//diag_log("DEBUG: Spawning a crashed " + _spawnveh + " with " + _spawnloot + " at " + str(_position));
|
||||
|
||||
_veh = _spawnveh createVehicleLocal _position;
|
||||
_veh enableSimulation false;
|
||||
|
||||
// Randomize placement a bit
|
||||
_veh setDir _direction;
|
||||
_veh setpos _position;
|
||||
|
||||
} count _this;
|
||||
@@ -1,9 +0,0 @@
|
||||
private["_type","_tent","_pos"];
|
||||
_type = _this select 0;
|
||||
_pos = _this select 1;
|
||||
|
||||
_tent = nearestObject [_type,_pos];
|
||||
|
||||
if (!isNull _tent) then {
|
||||
if (local _tent) then {deleteVehicle _tent};
|
||||
};
|
||||
@@ -1,5 +1,5 @@
|
||||
private ["_nearByObjects","_targetObject","_error","_range","_objects"];
|
||||
|
||||
//Object Array, Range, Error Message (@Skaronator)
|
||||
_objects = _this select 0;
|
||||
_range = _this select 1;
|
||||
_error = _this select 2;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
if (local _unit) then {
|
||||
deleteVehicle _unit;
|
||||
};
|
||||
@@ -1,58 +1,70 @@
|
||||
/*
|
||||
count player magazines with ammo count
|
||||
value = call player_countMagazines;
|
||||
value = call player_countMagazines; //must be called from a spawned thread (|| use spawn)
|
||||
return all player magazines with ammo count
|
||||
Modified to save backpack magazine count by icomrade - Base for fix by Ziellos2k
|
||||
*/
|
||||
private ["_dialog","_created","_magazineArray"];
|
||||
private ["_control","_item","_val","_max","_count","_magazineArray","_dialog"];
|
||||
disableSerialization;
|
||||
disableUserInput true;
|
||||
|
||||
_dialog = findDisplay 106;
|
||||
_created = false;
|
||||
_magazineArray = [[],[]];
|
||||
_dialog = ["0"] call gearDialog_create;
|
||||
if ((isNull _dialog) || (isNil "_dialog")) exitWith {disableUserInput false; (findDisplay 106) closeDisplay 0; closeDialog 0; _magazineArray};
|
||||
|
||||
if ( isNull _dialog ) then {
|
||||
//startLoadingScreen [""];
|
||||
createGearDialog [player, "RscDisplayGear"];
|
||||
_dialog = findDisplay 106;
|
||||
_created = true;
|
||||
};
|
||||
|
||||
_magazineArray = [];
|
||||
|
||||
for "_i" from 109 to 120 do
|
||||
{
|
||||
//Main inventory
|
||||
for "_i" from 109 to 120 do {
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
_magazineArray set [count _magazineArray,[_item,_val]];
|
||||
(_magazineArray select 0) set [count (_magazineArray select 0),[_item,_val]];
|
||||
} else {
|
||||
_magazineArray set [count _magazineArray,_item];
|
||||
(_magazineArray select 0) set [count (_magazineArray select 0),_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
for "_i" from 122 to 129 do
|
||||
{
|
||||
//Pistol/secondary ammo
|
||||
for "_i" from 122 to 129 do {
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
_magazineArray set [count _magazineArray,[_item,_val]];
|
||||
(_magazineArray select 0) set [count (_magazineArray select 0),[_item,_val]];
|
||||
} else {
|
||||
_magazineArray set [count _magazineArray,_item];
|
||||
(_magazineArray select 0) set [count (_magazineArray select 0),_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if ( _created ) then {
|
||||
closeDialog 0;
|
||||
//endLoadingScreen;
|
||||
//backpack items
|
||||
if ((typeOf (unitBackPack player)) != "") then {
|
||||
_count = getNumber (configFile >> "CfgVehicles" >> (typeOf (unitBackpack Player)) >> "transportMaxMagazines");
|
||||
ctrlActivate (_dialog displayCtrl 157);
|
||||
if (gear_done) then {
|
||||
waitUntil {ctrlShown (_dialog displayCtrl 159)};
|
||||
uiSleep 0.001;
|
||||
};
|
||||
|
||||
disableUserInput false;
|
||||
for "_i" from 5000 to (5000 + _count) do {
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
(_magazineArray select 1) set [count (_magazineArray select 1),[_item,_val]];
|
||||
} else {
|
||||
(_magazineArray select 1) set [count (_magazineArray select 1),_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
(findDisplay 106) closeDisplay 0;
|
||||
if (gear_done) then {uiSleep 0.001;};
|
||||
_magazineArray
|
||||
@@ -1,49 +0,0 @@
|
||||
private ["_objects"];
|
||||
_objects = nearestObjects [player, dayz_updateObjects, 10];
|
||||
{
|
||||
//["PVDZE_veh_Update",[_x,"gear"]] call callRpcProcedure;
|
||||
PVDZE_veh_Update = [_x,"gear"];
|
||||
publicVariableServer "PVDZE_veh_Update";
|
||||
|
||||
} count _objects;
|
||||
|
||||
private["_dialog","_magazineArray","_control","_item","_val","_max"];
|
||||
|
||||
disableSerialization;
|
||||
_dialog = _this select 0;
|
||||
_magazineArray = [];
|
||||
|
||||
//Primary Mags
|
||||
for "_i" from 109 to 120 do
|
||||
{
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_item == "BoltSteel") then { _item = "WoodenArrow" };
|
||||
if (_val != _max) then {
|
||||
_magazineArray set [count _magazineArray,[_item,_val]];
|
||||
} else {
|
||||
_magazineArray set [count _magazineArray,_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Secondary Mags
|
||||
for "_i" from 122 to 129 do
|
||||
{
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
_magazineArray set [count _magazineArray,[_item,_val]];
|
||||
} else {
|
||||
_magazineArray set [count _magazineArray,_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
dayz_unsaved = true;
|
||||
dayz_Magazines = _magazineArray;
|
||||
@@ -1,3 +1,4 @@
|
||||
//Trader ["Trader City Name",false,"enter"] - Trader City Name | Show Message | "enter" || "leave"
|
||||
private ["_traderName","_showText","_enterORleave"];
|
||||
_traderName = _this select 0;
|
||||
_showText = _this select 1;
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
private ["_iPos","_tQty","_qty","_index","_weights","_cntWeights","_canType","_item","_magQty","_mags","_item2","_itemTypes","_max","_iItem","_iClass","_radius","_uniq","_iPosZ"];
|
||||
_iItem = _this select 0;
|
||||
_iClass = _this select 1;
|
||||
_iPos = _this select 2;
|
||||
_radius = _this select 3;
|
||||
_uniq = [];
|
||||
|
||||
_item = objNull;
|
||||
|
||||
_iPosZ = _iPos select 2;
|
||||
if((isNil "_iPosZ") || {( _iPosZ < 0)}) then { _iPos = [_iPos select 0,_iPos select 1,0]; };
|
||||
if (isNil "_iClass") exitWith {diag_log "_iClass isNil, exiting loot spawn!";};
|
||||
|
||||
switch (_iClass) do {
|
||||
default {
|
||||
_itemTypes = [];
|
||||
if (DZE_MissionLootTable) then {
|
||||
{
|
||||
_itemTypes set [count _itemTypes, _x select 0]
|
||||
} count getArray (missionConfigFile >> "cfgLoot" >> _iClass);
|
||||
} else {
|
||||
{
|
||||
_itemTypes set [count _itemTypes, _x select 0]
|
||||
} count getArray (configFile >> "cfgLoot" >> _iClass);
|
||||
};
|
||||
_qty = 0;
|
||||
_max = ceil(random 2) + 1;
|
||||
if (_iClass in ["trash","civilian","office","office2","food","generic","medical","hospital","military","militarypilot","policeman","hunter","worker"]) then {
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
while {_qty < _max} do {
|
||||
_index = dayz_CLBase find _iClass;
|
||||
_weights = dayz_CLChances select _index;
|
||||
_cntWeights = count _weights;
|
||||
|
||||
// diag_log ("dayz_CLChances: "+str(dayz_CLChances));
|
||||
|
||||
_index = floor(random _cntWeights);
|
||||
_index = _weights select _index;
|
||||
|
||||
//diag_log ("dayz_CLChances: "+str(_itemTypes));
|
||||
|
||||
_canType = _itemTypes select _index;
|
||||
_tQty = round(random 1) + 1;
|
||||
if (_canType in _uniq) then {
|
||||
if (({_x in _uniq} count magazines _item) == 0) then { _tQty = 1; } else { _tQty = 0;};
|
||||
if (_tQty == 0) then {diag_log(format["%1 Prevent any duplicate member %2 from family %3",__FILE__, _canType, _uniq]);};
|
||||
};
|
||||
if (_tQty > 0) then {
|
||||
if (!(_canType in _uniq)) then {
|
||||
_item addMagazineCargoGlobal [_canType,1];
|
||||
_uniq set [count _uniq, _canType];
|
||||
_qty = _qty + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
if ((_iItem != "") && (isClass(configFile >> "CfgWeapons" >> _iItem))) then {
|
||||
_item addWeaponCargoGlobal [_iItem,1];
|
||||
};
|
||||
}
|
||||
else {
|
||||
// diag_log format["DEBUG dayz_CLBase: %1", dayz_CLBase];
|
||||
_index = dayz_CLBase find _iClass;
|
||||
if (_index > 0) then {
|
||||
_weights = dayz_CLChances select _index;
|
||||
//diag_log format["DEBUG dayz_CLChances: %1", dayz_CLChances];
|
||||
_cntWeights = count _weights;
|
||||
_index = floor(random _cntWeights);
|
||||
_index = _weights select _index;
|
||||
_item2 = _itemTypes select _index;
|
||||
if ((_item2 != "") && (isClass(configFile >> "CfgWeapons" >> _item2))) then{
|
||||
_item = createVehicle["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item addWeaponCargoGlobal[_item2, 1];
|
||||
if ((count _mags) > 0) then{
|
||||
if (_mags select 0 == "20Rnd_556x45_Stanag") then{ _mags set[0, "30Rnd_556x45_Stanag"] };
|
||||
if (_mags select 0 == "30Rnd_556x45_G36") then{ _mags set[0, "30Rnd_556x45_Stanag"] };
|
||||
if (_mags select 0 == "30Rnd_556x45_G36SD") then{ _mags set[0, "30Rnd_556x45_StanagSD"] };
|
||||
if (!(_item2 in MeleeWeapons)) then{
|
||||
_magQty = round(random 10);
|
||||
if (_magQty > 3) then{
|
||||
_item addMagazineCargoGlobal[(_mags select 0), (round(random 1) + 1)];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
if ((_item2 != "") && (isClass(configFile >> "CfgMagazines" >> _item2))) then{
|
||||
_item = createVehicle["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item addMagazineCargoGlobal[_item2, 1];
|
||||
};
|
||||
if ((_item2 != "") && (isClass(configFile >> "CfgVehicles" >> _item2))) then{
|
||||
_item = createVehicle[_item2, _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
case "single":
|
||||
{
|
||||
//Item is sigle, add 1 item from cfgloot
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_itemTypes = [];
|
||||
if (DZE_MissionLootTable) then{
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(missionConfigFile >> "cfgLoot" >> _iItem);
|
||||
}
|
||||
else {
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(configFile >> "cfgLoot" >> _iItem);
|
||||
};
|
||||
_index = dayz_CLBase find _iItem;
|
||||
_weights = dayz_CLChances select _index;
|
||||
_cntWeights = count _weights;
|
||||
|
||||
_index = floor(random _cntWeights);
|
||||
_index = _weights select _index;
|
||||
_canType = _itemTypes select _index;
|
||||
_item addMagazineCargoGlobal [_canType,1];
|
||||
};
|
||||
case "backpack":
|
||||
{
|
||||
//Item is single backpack
|
||||
_itemTypes = [];
|
||||
if (DZE_MissionLootTable) then {
|
||||
_itemTypes = ((getArray (missionConfigFile >> "cfgLoot" >> _iItem)) select 0);
|
||||
} else {
|
||||
_itemTypes = ((getArray (configFile >> "cfgLoot" >> _iItem)) select 0);
|
||||
};
|
||||
_index = dayz_CLBase find _iItem;
|
||||
_weights = dayz_CLChances select _index;
|
||||
_cntWeights = count _weights;
|
||||
_index = floor(random _cntWeights);
|
||||
_index = _weights select _index;
|
||||
_iItem = _itemTypes select _index;
|
||||
|
||||
_item = createVehicle [_iItem, _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
};
|
||||
case "cfglootweapon":
|
||||
{
|
||||
_itemTypes = [];
|
||||
if (DZE_MissionLootTable) then{
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(missionConfigFile >> "cfgLoot" >> _iItem);
|
||||
}
|
||||
else {
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(configFile >> "cfgLoot" >> _iItem);
|
||||
};
|
||||
_index = dayz_CLBase find _iItem;
|
||||
_weights = dayz_CLChances select _index;
|
||||
_cntWeights = count _weights;
|
||||
|
||||
_index = floor(random _cntWeights);
|
||||
_index = _weights select _index;
|
||||
_iItem = _itemTypes select _index;
|
||||
|
||||
if (_iItem == "Chainsaw") then {
|
||||
_iItem = ["ChainSaw","ChainSawB","ChainSawG","ChainSawP","ChainSawR"] call BIS_fnc_selectRandom;
|
||||
};
|
||||
|
||||
//Item is a weapon, add it && a random quantity of magazines
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item addWeaponCargoGlobal [_iItem,1];
|
||||
_mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines");
|
||||
if ((count _mags) > 0) then
|
||||
{
|
||||
if (_mags select 0 == "Quiver") then { _mags set [0, "WoodenArrow"] }; // Prevent spawning a Quiver
|
||||
if (_mags select 0 == "20Rnd_556x45_Stanag") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
||||
if (_mags select 0 == "30Rnd_556x45_G36") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
||||
if (_mags select 0 == "30Rnd_556x45_G36SD") then { _mags set [0, "30Rnd_556x45_StanagSD"] };
|
||||
_item addMagazineCargoGlobal [(_mags select 0), (round(random 2))];
|
||||
};
|
||||
|
||||
};
|
||||
case "weapon":
|
||||
{
|
||||
//Item is a weapon, add it && a random quantity of magazines
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item addWeaponCargoGlobal [_iItem,1];
|
||||
_mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines");
|
||||
if ((count _mags) > 0) then
|
||||
{
|
||||
if (_mags select 0 == "Quiver") then { _mags set [0, "WoodenArrow"] }; // Prevent spawning a Quiver
|
||||
if (_mags select 0 == "20Rnd_556x45_Stanag") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
||||
if (_mags select 0 == "30Rnd_556x45_G36") then { _mags set [0, "30Rnd_556x45_Stanag"] };
|
||||
if (_mags select 0 == "30Rnd_556x45_G36SD") then { _mags set [0, "30Rnd_556x45_StanagSD"] };
|
||||
if (!(_iItem in MeleeWeapons)) then {
|
||||
_magQty = round(random 10);
|
||||
if (_magQty > 3) then {
|
||||
_item addMagazineCargoGlobal [(_mags select 0), (round(random 1) + 1)];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
case "weaponnomags":
|
||||
{
|
||||
//Item is a weapon, && spawns no mags
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item addWeaponCargoGlobal [_iItem,1];
|
||||
};
|
||||
case "magazine":
|
||||
{
|
||||
//Item is one magazine
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item addMagazineCargoGlobal [_iItem,1];
|
||||
};
|
||||
case "object": {
|
||||
_item = createVehicle [_iItem, _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
if ((count _iPos) > 2) then {
|
||||
_item setPosATL _iPos;
|
||||
};
|
||||
};
|
||||
};
|
||||
if (!isNull(_item)) then{
|
||||
if ((count _iPos) > 2) then{
|
||||
_item setPosATL _iPos;
|
||||
};
|
||||
};
|
||||
|
||||
_item
|
||||
@@ -1,124 +0,0 @@
|
||||
|
||||
private ["_iItem","_iClass","_iPos","_radius","_item","_itemTypes","_index","_weights","_cntWeights","_canType","_dateNow"];
|
||||
|
||||
_iItem = _this select 0;
|
||||
_iClass = _this select 1;
|
||||
//diag_log format["DEBUG spawn loot class: %1", _iClass];
|
||||
_iPos = _this select 2;
|
||||
_radius = _this select 3;
|
||||
|
||||
_item = objNull;
|
||||
|
||||
switch (_iClass) do
|
||||
{
|
||||
default
|
||||
{
|
||||
//Item is sigle, add 1 item from CfgLootSmall
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_itemTypes = [];
|
||||
if (DZE_MissionLootTable) then{
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(missionConfigFile >> "CfgLootSmall" >> _iClass);
|
||||
}
|
||||
else {
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(configFile >> "CfgLootSmall" >> _iClass);
|
||||
};
|
||||
_index = dayzE_CLSBase find _iClass;
|
||||
|
||||
_weights = dayzE_CLSChances select _index;
|
||||
_cntWeights = count _weights;
|
||||
|
||||
_index = floor(random _cntWeights);
|
||||
_index = _weights select _index;
|
||||
_canType = _itemTypes select _index;
|
||||
_item addMagazineCargoGlobal [_canType,1];
|
||||
};
|
||||
case "single":
|
||||
{
|
||||
//Item is sigle, add 1 item from CfgLootSmall
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
|
||||
_itemTypes = [];
|
||||
if (DZE_MissionLootTable) then{
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(missionConfigFile >> "CfgLootSmall" >> _iItem);
|
||||
}
|
||||
else {
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(configFile >> "CfgLootSmall" >> _iItem);
|
||||
};
|
||||
_index = dayzE_CLSBase find _iItem;
|
||||
_weights = dayzE_CLSChances select _index;
|
||||
_cntWeights = count _weights;
|
||||
|
||||
_index = floor(random _cntWeights);
|
||||
_index = _weights select _index;
|
||||
_canType = _itemTypes select _index;
|
||||
_item addMagazineCargoGlobal [_canType,1];
|
||||
};
|
||||
case "cfglootweapon":
|
||||
{
|
||||
//Item is sigle, add 1 item from cfgloot
|
||||
|
||||
_itemTypes = [];
|
||||
if (DZE_MissionLootTable) then{
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(missionConfigFile >> "CfgLootSmall" >> _iItem);
|
||||
}
|
||||
else {
|
||||
{
|
||||
_itemTypes set[count _itemTypes, _x select 0]
|
||||
} count getArray(configFile >> "CfgLootSmall" >> _iItem);
|
||||
};
|
||||
_index = dayzE_CLSBase find _iItem;
|
||||
_weights = dayzE_CLSChances select _index;
|
||||
_cntWeights = count _weights;
|
||||
|
||||
//diag_log("_itemTypes small:" + str(_itemTypes));
|
||||
|
||||
_index = floor(random _cntWeights);
|
||||
_index = _weights select _index;
|
||||
_iItem = _itemTypes select _index;
|
||||
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item addWeaponCargoGlobal [_iItem,1];
|
||||
|
||||
};
|
||||
case "weapon":
|
||||
{
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item addWeaponCargoGlobal [_iItem,1];
|
||||
};
|
||||
case "magazine":
|
||||
{
|
||||
//Item is one magazine
|
||||
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
|
||||
_item addMagazineCargoGlobal [_iItem,1];
|
||||
};
|
||||
|
||||
case "weaponnomags":
|
||||
{
|
||||
//do nothing for now
|
||||
};
|
||||
case "backpack":
|
||||
{
|
||||
//do nothing for now
|
||||
};
|
||||
case "object":
|
||||
{
|
||||
//do nothing for now
|
||||
};
|
||||
};
|
||||
if (!isNull(_item)) then{
|
||||
if ((count _iPos) > 2) then{
|
||||
_item setPosATL _iPos;
|
||||
};
|
||||
};
|
||||
|
||||
_item
|
||||
@@ -37,8 +37,8 @@ if (local _unit) then {
|
||||
_unit setHit [_selection, _total];
|
||||
|
||||
if (!isServer) then {
|
||||
PVDZ_veh_Save = [_unit,"damage"];
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
PVDZE_veh_Update = [_unit,"damage"];
|
||||
publicVariableServer "PVDZE_veh_Update";
|
||||
} else {
|
||||
[_unit, "damage"] call server_updateObject;
|
||||
};
|
||||
@@ -47,8 +47,8 @@ if (local _unit) then {
|
||||
//if ( (count _this > 5) AND {(_this select 5)}) then {
|
||||
// vehicle is not local to this client, ask the client which vehicle is local to set damage
|
||||
//_this resize 5; // delete "broadcast" boolean
|
||||
PVDZ_send = [_unit,"VehHandleDam",_this];
|
||||
publicVariableServer "PVDZ_send";
|
||||
PVDZE_send = [_unit,"VehHandleDam",_this];
|
||||
publicVariableServer "PVDZE_send";
|
||||
//};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,14 +1,24 @@
|
||||
private["_unit","_hitPoints","_selection","_killer"];
|
||||
|
||||
_unit = _this select 0;
|
||||
//_killer = _this select 1;
|
||||
_killer = _this select 1;
|
||||
|
||||
_hitPoints = _unit call vehicle_getHitpoints;
|
||||
{
|
||||
_selection = getText (configFile >> "CfgVehicles" >> (typeof _unit) >> "HitPoints" >> _x >> "name");
|
||||
_unit setVariable [_selection, 1, true];
|
||||
} count _hitPoints;
|
||||
|
||||
// ask server to set global damage to 1, save to the hive
|
||||
if (local _unit) then {
|
||||
if (isServer) then {
|
||||
[_unit, "killed"] call server_updateObject;
|
||||
} else {
|
||||
PVDZ_veh_Save = [_unit, "killed"];
|
||||
publicVariableServer "PVDZ_veh_Save";
|
||||
if (DZE_Debug_Damage && ((!isPlayer _unit) || ((isPlayer _unit) && (vehicle _unit != _unit) && (_unit != _killer)))) then {
|
||||
PVDZE_veh_Update = [_unit, "killed",_killer];
|
||||
} else {
|
||||
PVDZE_veh_Update = [_unit, "killed"];
|
||||
};
|
||||
publicVariableServer "PVDZE_veh_Update";
|
||||
};
|
||||
|
||||
// everyone removes their EH for this vehicle
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/***********************************************************
|
||||
ASSIGN DAMAGE TO A UNIT
|
||||
- Function Vehicle_HandleDamage
|
||||
- [unit, selectionName, damage, source, projectile] call Vehicle_HandleDamage;
|
||||
************************************************************/
|
||||
private["_unit","_selection","_strH","_total","_damage","_needUpdate"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_selection = _this select 1;
|
||||
_total = _this select 2;
|
||||
|
||||
if (_selection != "") then {
|
||||
_strH = "hit_" + _selection;
|
||||
} else {
|
||||
_strH = "totalDmg";
|
||||
};
|
||||
|
||||
if (_total >= 0.98) then {
|
||||
_total = 1.0;
|
||||
};
|
||||
|
||||
if (local _unit) then {
|
||||
if (_total > 0) then {
|
||||
|
||||
_unit setVariable [_strH, _total, true];
|
||||
_unit setHit [_selection, _total];
|
||||
|
||||
if (isServer) then {
|
||||
[_unit, "damage"] call server_updateObject;
|
||||
} else {
|
||||
PVDZE_veh_Update = [_unit,"damage"];
|
||||
publicVariableServer "PVDZE_veh_Update";
|
||||
};
|
||||
};
|
||||
} else {
|
||||
// vehicle is not local to this client, ask the client which vehicle is local to set damage
|
||||
/* PVS/PVC - Skaronator */
|
||||
PVDZE_send = [_unit,"VehHandleDam",_this];
|
||||
publicVariableServer "PVDZE_send";
|
||||
};
|
||||
|
||||
// all "HandleDamage event" functions should return the effective damage that the engine will record for that part
|
||||
_total
|
||||
@@ -1,29 +0,0 @@
|
||||
private["_unit","_hitPoints","_selection","_killer"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_killer = _this select 1;
|
||||
|
||||
_hitPoints = _unit call vehicle_getHitpoints;
|
||||
{
|
||||
_selection = getText (configFile >> "CfgVehicles" >> (typeof _unit) >> "HitPoints" >> _x >> "name");
|
||||
_unit setVariable [_selection, 1, true];
|
||||
} count _hitPoints;
|
||||
|
||||
//["PVDZE_veh_Update",[_unit, "damage"]] call callRpcProcedure;
|
||||
if (isServer) then {
|
||||
[_unit, "killed"] call server_updateObject;
|
||||
} else {
|
||||
if (DZE_Debug_Damage && ((!isPlayer _unit) || ((isPlayer _unit) && (vehicle _unit != _unit) && (_unit != _killer)))) then {
|
||||
PVDZE_veh_Update = [_unit, "killed",_killer];
|
||||
_killerVeh = if (vehicle _killer != _killer) then { format["[KILLER IN VEHICLE %1 OF TYPE %2]", (vehicle _killer), (typeOf (vehicle _killer))]; } else {""};
|
||||
_name = if (alive _killer) then { name _killer; } else { format["OBJECT %1", _killer]; };
|
||||
} else {
|
||||
PVDZE_veh_Update = [_unit, "killed"];
|
||||
};
|
||||
publicVariableServer "PVDZE_veh_Update";
|
||||
};
|
||||
|
||||
_unit removeAllEventHandlers "HandleDamage";
|
||||
_unit removeAllEventHandlers "Killed";
|
||||
_unit removeAllEventHandlers "GetIn";
|
||||
_unit removeAllEventHandlers "GetOut";
|
||||
@@ -1,11 +1,10 @@
|
||||
if (isServer) then {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
|
||||
|
||||
pvs_processSetAccessCode = compile preprocessFile "\z\addons\dayz_code\eventHandlers\processSetAccessCode.sqf";
|
||||
};
|
||||
|
||||
if (!isDedicated) then {
|
||||
|
||||
// "filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
|
||||
"filmic" setToneMappingParams [0.07, 0.31, 0.23, 0.37, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
|
||||
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_padlock.sqf";
|
||||
@@ -21,52 +20,29 @@ if (!isDedicated) then {
|
||||
fnc_usec_damageActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageActions.sqf"; //Checks which actions for nearby casualty
|
||||
fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty
|
||||
fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf"; //Checks which actions for self
|
||||
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
|
||||
fnc_usec_upgradeActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_upgradeActions.sqf";
|
||||
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
|
||||
player_temp_calculation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_temperatur.sqf"; //Temperatur System //TeeChange
|
||||
player_weaponFiredNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponFiredNear.sqf";
|
||||
//player_animalCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_animalCheck.sqf";
|
||||
player_spawnCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnCheck.sqf";
|
||||
player_dumpBackpack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_dumpBackpack.sqf";
|
||||
//player_spawnLootCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnlootCheck.sqf";
|
||||
//player_spawnZedCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_spawnzedCheck.sqf";
|
||||
building_spawnLoot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf";
|
||||
//player_taskHint = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_taskHint.sqf";
|
||||
building_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf";
|
||||
player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; //Runs when player fires. Alerts nearby Zeds depending on calibre && audial rating
|
||||
player_harvest = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_harvest.sqf";
|
||||
//animal_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\animal_monitor.sqf";
|
||||
//building_monitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\building_monitor.sqf";
|
||||
player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; //Runs when player fires. Alerts nearby Zeds depending on calibre and audial rating
|
||||
player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf";
|
||||
player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf";
|
||||
player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";
|
||||
|
||||
player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";
|
||||
player_removeNearby = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNearby.sqf";
|
||||
|
||||
player_removeTankTrap = {
|
||||
//Object Array, Range, Error Message (@Skaronator)
|
||||
[["Hedgehog_DZ"], 1,"STR_EPOCH_ACTIONS_14"] call player_removeNearby;
|
||||
};
|
||||
player_removeNet = {
|
||||
[["DesertCamoNet_DZ","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ"], 5,"str_epoch_player_8"] call player_removeNearby;
|
||||
};
|
||||
|
||||
player_login = {
|
||||
private ["_unit","_detail","_PUID"];
|
||||
_unit = _this select 0;
|
||||
_detail = _this select 1;
|
||||
_PUID = [player] call FNC_GetPlayerUID;
|
||||
if(_unit == _PUID) then {
|
||||
player setVariable["publish",_detail];
|
||||
};
|
||||
};
|
||||
|
||||
player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf";
|
||||
player_changeCombo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_changeCombo.sqf";
|
||||
|
||||
player_lockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_lockVault.sqf";
|
||||
//control_zombieAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\control_zombieAgent.sqf";
|
||||
player_updateGui = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_updateGui.sqf";
|
||||
player_crossbowBolt = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_crossbowBolt.sqf";
|
||||
stream_locationFill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationFill.sqf";
|
||||
stream_locationDel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationDel.sqf";
|
||||
stream_locationCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\stream_locationCheck.sqf";
|
||||
player_music = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_music.sqf"; //Used to generate ambient music
|
||||
//player_login = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_login.sqf"; //Used to generate ambient music
|
||||
player_death = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_death.sqf";
|
||||
player_switchModel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_switchModel.sqf";
|
||||
player_checkStealth = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_checkStealth.sqf";
|
||||
@@ -76,92 +52,69 @@ if (!isDedicated) then {
|
||||
player_throwObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_throwObject.sqf";
|
||||
player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
|
||||
player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
|
||||
//USE THE ONE IN /ACTIONS //player_countMagazines = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_countMagazines.sqf";
|
||||
player_countMagazines = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_countMagazines.sqf";
|
||||
player_forceSave = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_forceSave.sqf";
|
||||
//player_destroyTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_destroyTent.sqf";
|
||||
player_Bubble = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_Bubble.sqf";
|
||||
fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf";
|
||||
|
||||
//Objects
|
||||
fn_buildCamera = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildCamera.sqf";
|
||||
object_setpitchbank = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setpitchbank.sqf";
|
||||
object_monitorGear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
|
||||
object_dismantle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_dismantle.sqf";
|
||||
|
||||
//GetOut
|
||||
vehicle_getOut = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getOut.sqf";
|
||||
|
||||
local_roadDebris = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_roadDebris.sqf";
|
||||
|
||||
//Zombies
|
||||
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
|
||||
player_zombieSwarmAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieSwarmAttack.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 behaviours
|
||||
//zombie_generateSwarm = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\swarm_generate.sqf";
|
||||
|
||||
pz_attack = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf";
|
||||
|
||||
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
|
||||
|
||||
//actions
|
||||
player_countmagazines = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_countmagazines.sqf";
|
||||
player_addToolbelt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addToolbelt.sqf";
|
||||
player_addtoBack = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addtoBack.sqf";
|
||||
player_copyKey = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_copyKey.sqf";
|
||||
player_reloadMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_reloadMags.sqf";
|
||||
player_createstash = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_createstash.sqf";
|
||||
player_loadCrate = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_loadCrate.sqf";
|
||||
player_craftItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
|
||||
player_tentPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\tent_pitch.sqf";
|
||||
player_vaultPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\vault_pitch.sqf";
|
||||
player_drink = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drink.sqf";
|
||||
player_eat = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_eat.sqf";
|
||||
player_drinkWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drinkWater.sqf"; //1.8.7
|
||||
player_consume = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_consume.sqf"; //1.8.7
|
||||
player_drinkWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_drinkWater.sqf";
|
||||
player_consume = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_consume.sqf";
|
||||
player_emptyContainer = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_emptyContainer.sqf";
|
||||
player_useMeds = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_useMeds.sqf";
|
||||
player_useAttchment = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_useAttchment.sqf";
|
||||
player_attachAttachment = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_attachAttachment.sqf";
|
||||
player_removeAttachment = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_removeAttachment.sqf";
|
||||
player_chopWood = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf";
|
||||
player_mineStone = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_mineStone.sqf";
|
||||
player_fillWater = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\water_fill.sqf";
|
||||
player_makeFire = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_makefire.sqf";
|
||||
player_harvestPlant = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_harvestPlant.sqf";
|
||||
player_goFishing = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_goFishing.sqf";
|
||||
object_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_build.sqf";
|
||||
player_dropWeapon = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_dropWeapon.sqf";
|
||||
|
||||
player_chopWood = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_chopWood.sqf";
|
||||
player_mineStone = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_mineStone.sqf";
|
||||
if (DZE_modularBuild) then {
|
||||
player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\modular_build.sqf";
|
||||
snap_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\snap_build.sqf";
|
||||
} else {
|
||||
player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";
|
||||
};
|
||||
|
||||
object_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_build.sqf";
|
||||
object_upgradeFireplace = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_upgradeFireplace.sqf";
|
||||
player_wearClothes = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_wearClothes.sqf";
|
||||
player_dropWeapon = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_dropWeapon.sqf";
|
||||
//player_setTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_setTrap.sqf";
|
||||
object_pickup = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_pickup.sqf";
|
||||
//player_flipvehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_flipvehicle.sqf";
|
||||
//player_sleep = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
|
||||
player_combineMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineMags.sqf";
|
||||
player_createquiver = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_createQuiver.sqf";
|
||||
player_fillquiver = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_fillQuiver.sqf";
|
||||
|
||||
player_wearClothes = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_wearClothes.sqf";
|
||||
object_pickup = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_pickup.sqf";
|
||||
//player_takearrow = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_takeArrow.sqf";
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_switchWeapon.sqf";
|
||||
player_flipvehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_flipvehicle.sqf";
|
||||
player_sleep = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
|
||||
player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";
|
||||
player_deathBoard = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf";
|
||||
//player_goFishing = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_goFishing.sqf";
|
||||
player_gather = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_gather.sqf";
|
||||
player_fixBottle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_fixBottle.sqf";
|
||||
player_tearClothes = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_tearClothes.sqf";
|
||||
//object_remove = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";
|
||||
player_fixHatchet = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_fixTools.sqf";
|
||||
player_sharpen = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sharpen.sqf";
|
||||
|
||||
player_plotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_showPlotRadius.sqf";
|
||||
player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf";
|
||||
|
||||
//ui
|
||||
player_selectSlot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_selectSlot.sqf";
|
||||
player_gearSync = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSync.sqf";
|
||||
player_gearSet = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_gearSet.sqf";
|
||||
ui_changeDisplay = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_changeDisplay.sqf";
|
||||
ui_gear_sound = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\ui_gear_sound.sqf";
|
||||
@@ -179,6 +132,7 @@ if (!isDedicated) then {
|
||||
player_spawn_1 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_1.sqf";
|
||||
player_spawn_2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
|
||||
infectedcamps = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_infectedcamps.sqf";
|
||||
//camp_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\camp_spawnZombies.sqf"; //Server compile, used for loiter behaviour
|
||||
|
||||
//Crafting
|
||||
fn_updateCraftUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_updateCraftUI.sqf";
|
||||
@@ -186,86 +140,43 @@ if (!isDedicated) then {
|
||||
player_craftItemGUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItemGUI.sqf";
|
||||
player_checkRecipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_checkRecipe.sqf";
|
||||
|
||||
object_upgradeFireplace = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_upgradeFireplace.sqf";
|
||||
|
||||
fn_buildCamera = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildCamera.sqf";
|
||||
|
||||
onPreloadStarted "dayz_preloadFinished = false;";
|
||||
onPreloadFinished "if (!isNil 'init_keyboard') then { [] spawn init_keyboard; }; dayz_preloadFinished = true;";
|
||||
|
||||
// helper functions
|
||||
player_addDuplicateTool = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_addDuplicateTool.sqf";
|
||||
player_hasTools = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_hasTools.sqf";
|
||||
player_checkItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_checkItems.sqf";
|
||||
player_removeItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_removeItems.sqf";
|
||||
//Trader ["Trader City Name",false,"enter"] - Trader City Name | Show Message | "enter" || "leave"
|
||||
player_traderCity = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderCity.sqf";
|
||||
|
||||
// combination of check && remove items
|
||||
player_checkAndRemoveItems = {
|
||||
private ["_items","_b"];
|
||||
_items = _this;
|
||||
_b = _items call player_checkItems;
|
||||
if (_b) then {
|
||||
_b = _items call player_removeItems;
|
||||
};
|
||||
_b
|
||||
};
|
||||
|
||||
dayz_HungerThirst = {
|
||||
dayz_hunger = dayz_hunger + (_this select 0);
|
||||
dayz_thirst = dayz_thirst + (_this select 1);
|
||||
};
|
||||
|
||||
epoch_tempKeys = {
|
||||
private ["_temp_keys","_temp_keys_names","_key_colors","_ownerKeyId","_ownerKeyName"];
|
||||
_temp_keys = [];
|
||||
_temp_keys_names = [];
|
||||
// find available keys
|
||||
_key_colors = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
|
||||
{
|
||||
if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _key_colors) then {
|
||||
_ownerKeyId = getNumber(configFile >> "CfgWeapons" >> _x >> "keyid");
|
||||
_ownerKeyName = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
|
||||
_temp_keys_names set [_ownerKeyId,_ownerKeyName];
|
||||
_temp_keys set [count _temp_keys,str(_ownerKeyId)];
|
||||
};
|
||||
} count (items player);
|
||||
[_temp_keys,_temp_keys_names]
|
||||
};
|
||||
|
||||
epoch_totalCurrency = {
|
||||
// total currency
|
||||
_total_currency = 0;
|
||||
{
|
||||
_part = (configFile >> "CfgMagazines" >> _x);
|
||||
_worth = (_part >> "worth");
|
||||
if isNumber (_worth) then {
|
||||
_total_currency = _total_currency + getNumber(_worth);
|
||||
};
|
||||
} count (magazines player);
|
||||
_total_currency
|
||||
};
|
||||
|
||||
epoch_itemCost = {
|
||||
_trade_total = 0;
|
||||
{
|
||||
_part_in_configClass = configFile >> "CfgMagazines" >> (_x select 0);
|
||||
if (isClass (_part_in_configClass)) then {
|
||||
_part_inWorth = (_part_in_configClass >> "worth");
|
||||
if isNumber (_part_inWorth) then {
|
||||
_trade_total = _trade_total + (getNumber(_part_inWorth) * (_x select 1));
|
||||
};
|
||||
};
|
||||
} count _this;
|
||||
|
||||
//diag_log format["DEBUG TRADER ITEMCOST: %1", _this];
|
||||
_trade_total
|
||||
};
|
||||
|
||||
// EPOCH ADDITIONS
|
||||
autoRunOff = {autoRunActive = 0; terminate autoRunThread; player playActionNow "Stop";};
|
||||
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
|
||||
dze_getModelName = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_getModelName.sqf";
|
||||
dze_isnearest_player = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_isNearestPlayer.sqf";
|
||||
dze_surrender_off = {player setVariable ["DZE_Surrendered",false,true]; DZE_Surrender = false;};
|
||||
epoch_tempKeys = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_tempKeys.sqf";
|
||||
epoch_totalCurrency = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_totalCurrency.sqf";
|
||||
epoch_itemCost = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_itemCost.sqf";
|
||||
epoch_returnChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\epoch_returnChange.sqf";
|
||||
// usage [["partinclassname",4]] call epoch_returnChange;
|
||||
|
||||
fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf";
|
||||
player_addDuplicateTool = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_addDuplicateTool.sqf";
|
||||
player_antiWall = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_antiWall.sqf";
|
||||
player_changeCombo = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_changeCombo.sqf";
|
||||
player_checkItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_checkItems.sqf";
|
||||
player_copyKey = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_copyKey.sqf";
|
||||
player_craftItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
|
||||
player_deathBoard = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\list_playerDeathsAlt.sqf";
|
||||
player_dumpBackpack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_dumpBackpack.sqf";
|
||||
player_harvest = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_harvest.sqf";
|
||||
player_harvestPlant = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_harvestPlant.sqf";
|
||||
player_hasTools = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_hasTools.sqf";
|
||||
player_loadCrate = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_loadCrate.sqf";
|
||||
player_lockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_lockVault.sqf";
|
||||
player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf";
|
||||
player_plotPreview = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_showPlotRadius.sqf";
|
||||
player_removeItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_removeItems.sqf";
|
||||
player_removeNearby = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_removeNearby.sqf";
|
||||
player_removeObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\remove.sqf";
|
||||
player_traderCity = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderCity.sqf";
|
||||
player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf";
|
||||
player_unlockVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockVault.sqf";
|
||||
player_upgradeVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_upgradeVehicle.sqf";
|
||||
player_vaultPitch = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\vault_pitch.sqf";
|
||||
player_checkAndRemoveItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_checkAndRemoveItems.sqf";
|
||||
pz_attack = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\pzombie\pz_attack.sqf";
|
||||
wild_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\wild_spawnZombies.sqf"; //Server compile, used for loiter behaviour
|
||||
dayz_losChance = {
|
||||
private["_agent","_maxDis","_dis","_val","_maxExp","_myExp"];
|
||||
_agent = _this select 0;
|
||||
@@ -281,7 +192,7 @@ if (!isDedicated) then {
|
||||
};
|
||||
|
||||
ui_initDisplay = {
|
||||
private["_control","_ctrlBleed","_display","_ctrlFracture","_ctrlDogFood","_ctrlDogWater","_ctrlDogWaterBorder", "_ctrlDogFoodBorder"];
|
||||
private ["_ctrlBleed","_ctrlFracture"];
|
||||
disableSerialization;
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_control = _display displayCtrl 1204;
|
||||
@@ -311,24 +222,24 @@ if (!isDedicated) then {
|
||||
_agent = _this select 1;
|
||||
_degree = _this select 2;
|
||||
_inAngle = false;
|
||||
_tPos = (getPosASL _target);
|
||||
_zPos = (getPosASL _agent);
|
||||
_eyeDir = (direction _agent);
|
||||
_tPos = getPosASL _target;
|
||||
_zPos = getPosASL _agent;
|
||||
_eyeDir = direction _agent;
|
||||
_inAngle = [_zPos,_eyeDir,_degree,_tPos] call fnc_inAngleSector;
|
||||
_inAngle
|
||||
};
|
||||
|
||||
dayz_losCheck = {
|
||||
private "_cantSee";
|
||||
private ["_cantSee","_target","_agent"];
|
||||
_target = _this select 0; // PUT THE PLAYER IN FIRST ARGUMENT!!!!
|
||||
_agent = _this select 1;
|
||||
_cantSee = true;
|
||||
|
||||
if ((!isNull _target) and (!isNull _agent)) then {
|
||||
if ((!isNull _target) && (!isNull _agent)) then {
|
||||
private ["_tPos","_zPos"];
|
||||
_tPos = eyePos _target;
|
||||
_zPos = eyePos _agent;
|
||||
if ((count _tPos > 0) and (count _zPos > 0)) then {
|
||||
if ((count _tPos > 0) && (count _zPos > 0)) then {
|
||||
_cantSee = terrainIntersectASL [(eyePos _target), (eyePos _agent)];
|
||||
//diag_log ("terrainIntersectASL: " + str(_cantSee));
|
||||
|
||||
@@ -340,53 +251,32 @@ if (!isDedicated) then {
|
||||
};
|
||||
_cantSee
|
||||
};
|
||||
/*
|
||||
dayz_dropItem = {
|
||||
private ["_nearByPile","_item"];
|
||||
|
||||
dayz_equipCheck = {
|
||||
private ["_empty", "_needed","_diff","_success"];
|
||||
_config = _this;
|
||||
_empty = [player] call BIS_fnc_invSlotsEmpty;
|
||||
_needed = [_config] call BIS_fnc_invSlotType;
|
||||
_diff = [_empty,_needed] call BIS_fnc_vectorDiff;
|
||||
_type = _this select 0;
|
||||
_dropItem = _this select 1;
|
||||
_dropAmount = _this select 2;
|
||||
|
||||
_success = true;
|
||||
{
|
||||
if (_x > 0) then {_success = false};
|
||||
} count _diff;
|
||||
hint format["Config: %5\nEmpty: %1\nNeeded: %2\nDiff: %3\nSuccess: %4",_empty,_needed,_diff,_success,_config];
|
||||
_success
|
||||
};
|
||||
|
||||
vehicle_gear_count = {
|
||||
private["_counter"];
|
||||
_counter = 0;
|
||||
{
|
||||
_counter = _counter + _x;
|
||||
} count _this;
|
||||
_counter
|
||||
};
|
||||
|
||||
player_tagFriendlyMsg = {
|
||||
if(player == (_this select 0)) then {
|
||||
cutText[(localize "str_epoch_player_2"),"PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
|
||||
player_serverModelChange = {
|
||||
private["_object","_model"];
|
||||
_object = _this select 0;
|
||||
_model = _this select 1;
|
||||
if (_object == player) then {
|
||||
_model call player_switchModel;
|
||||
_nearByPile = nearestObjects [(getPosATL player), ["WeaponHolder","WeaponHolderBase"],2];
|
||||
if (count _nearByPile == 0) then {
|
||||
_item = createVehicle ["WeaponHolder", (getPosATL player), [], 0.0, "CAN_COLLIDE"];
|
||||
} else {
|
||||
_item = _nearByPile select 0;
|
||||
};
|
||||
_item addMagazineCargoGlobal [_dropItem,_dropAmount];
|
||||
_item setvelocity [0,0,1];
|
||||
};
|
||||
*/
|
||||
|
||||
player_guiControlFlash = {
|
||||
private["_control"];
|
||||
private "_control";
|
||||
_control = _this;
|
||||
if (ctrlShown (_control select 0)) then {
|
||||
{_x ctrlShow false} foreach _control;
|
||||
{_x ctrlShow false} forEach _control;
|
||||
} else {
|
||||
{_x ctrlShow true} foreach _control;
|
||||
{_x ctrlShow true} forEach _control;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -424,6 +314,11 @@ if (!isDedicated) then {
|
||||
_dialog
|
||||
};
|
||||
|
||||
dayz_HungerThirst = {
|
||||
dayz_hunger = dayz_hunger + (_this select 0);
|
||||
dayz_thirst = dayz_thirst + (_this select 1);
|
||||
};
|
||||
|
||||
dayz_NutritionSystem = {
|
||||
private ["_type","_baseRegen","_nutrition","_calorieCount","_hungerCount","_thirstCount","_tempCount","_Thirst","_Hunger","_bloodregen","_golbalNutrition"];
|
||||
//["type",regen,[NutritionTable,thirst(Working Class),hunger(Working Class)]]
|
||||
@@ -506,19 +401,8 @@ if (!isDedicated) then {
|
||||
};
|
||||
};
|
||||
|
||||
dze_surrender_off = {
|
||||
player setVariable ["DZE_Surrendered", false, true];
|
||||
DZE_Surrender = false;
|
||||
};
|
||||
|
||||
autoRunOff = {
|
||||
autoRunActive = 0;
|
||||
terminate autoRunThread;
|
||||
player playActionNow "Stop";
|
||||
};
|
||||
|
||||
gear_ui_init = {
|
||||
private["_control","_parent","_menu","_dspl","_grpPos"];
|
||||
//private["_control","_parent","_menu","_grpPos"];
|
||||
disableSerialization;
|
||||
_parent = findDisplay 106;
|
||||
_control = _parent displayCtrl 6902;
|
||||
@@ -586,7 +470,7 @@ if (!isDedicated) then {
|
||||
private "_humanity";
|
||||
_humanity = _unit getVariable["humanity",0];
|
||||
dayz_heartBeat = true;
|
||||
if (_humanity < -5000) then {
|
||||
if (_humanity < -3000) then {
|
||||
private "_delay";
|
||||
_delay = ((10000 + _humanity) / 5500) + 0.3;
|
||||
playSound "heartbeat_1";
|
||||
@@ -596,121 +480,14 @@ if (!isDedicated) then {
|
||||
};
|
||||
};
|
||||
|
||||
dz_fn_meleeMagazines =
|
||||
{
|
||||
if (_this) then
|
||||
{
|
||||
{ player addMagazine _x } foreach MeleeMagazines;
|
||||
}
|
||||
else
|
||||
{
|
||||
{ player removeMagazines _x } foreach MeleeMagazines;
|
||||
};
|
||||
};
|
||||
|
||||
dayz_eyeDir = {
|
||||
private["_vval","_vdir"];
|
||||
_vval = (eyeDirection _this);
|
||||
_vdir = (_vval select 0) atan2 (_vval select 1);
|
||||
if (_vdir < 0) then {_vdir = 360 + _vdir};
|
||||
_vdir
|
||||
};
|
||||
|
||||
DZE_getModelName = {
|
||||
_objInfo = toArray(str(_this));
|
||||
_lenInfo = count _objInfo - 1;
|
||||
_objName = [];
|
||||
_i = 0;
|
||||
// determine where the object name starts
|
||||
{
|
||||
if (58 == _objInfo select _i) exitWith {};
|
||||
_i = _i + 1;
|
||||
} count _objInfo;
|
||||
_i = _i + 2; // skip the ": " part
|
||||
for "_k" from _i to _lenInfo do {
|
||||
_objName set [(count _objName), (_objInfo select _k)];
|
||||
};
|
||||
_objName = toLower(toString(_objName));
|
||||
_objName
|
||||
};
|
||||
|
||||
dze_isnearest_player = {
|
||||
private ["_notClosest","_playerDistance","_nearPlayers","_obj","_playerNear"];
|
||||
if(!isNull _this) then {
|
||||
_nearPlayers = _this nearEntities ["CAManBase", 12];
|
||||
_playerNear = ({isPlayer _x} count _nearPlayers) > 1;
|
||||
_notClosest = false;
|
||||
if (_playerNear) then {
|
||||
// check if another player is closer
|
||||
_playerDistance = player distance _this;
|
||||
{
|
||||
if (_playerDistance > (_x distance _this)) exitWith { _notClosest = true; };
|
||||
} count _nearPlayers;
|
||||
};
|
||||
dz_fn_meleeMagazines = {
|
||||
if (_this) then {
|
||||
{ player addMagazine _x } count MeleeMagazines;
|
||||
} else {
|
||||
_notClosest = false;
|
||||
{ player removeMagazines _x } count MeleeMagazines;
|
||||
};
|
||||
_notClosest
|
||||
};
|
||||
|
||||
// trader menu code
|
||||
if (DZE_ConfigTrader) then {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuConfig.sqf";
|
||||
}else{
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuHive.sqf";
|
||||
};
|
||||
// recent murders menu code
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_murderMenu.sqf";
|
||||
/*
|
||||
[] spawn {
|
||||
private["_timeOut","_display","_control1","_control2"];
|
||||
disableSerialization;
|
||||
_timeOut = diag_tickTime;
|
||||
dayz_loadScreenMsg = "";
|
||||
diag_log "DEBUG: loadscreen guard started.";
|
||||
_display = uiNameSpace getVariable "BIS_loadingScreen";
|
||||
if (!isNil "_display") then {
|
||||
_control1 = _display displayctrl 8400;
|
||||
_control2 = _display displayctrl 102;
|
||||
};
|
||||
if (!isNil "dayz_DisplayGenderSelect") then {
|
||||
waitUntil {!dayz_DisplayGenderSelect};
|
||||
};
|
||||
|
||||
// 120 sec timeout (12000 * 0.01)
|
||||
while { (_timeOut + 120) > diag_tickTime } do {
|
||||
if (dayz_clientPreload && dayz_authed) exitWith {
|
||||
diag_log "PLOGIN: Login loop completed!";
|
||||
endLoadingScreen;
|
||||
};
|
||||
if (!isNil "_display") then {
|
||||
if ( isNull _display ) then {
|
||||
waitUntil { !dialog; };
|
||||
startLoadingScreen ["","RscDisplayLoadCustom"];
|
||||
_display = uiNameSpace getVariable "BIS_loadingScreen";
|
||||
_control1 = _display displayctrl 8400;
|
||||
_control2 = _display displayctrl 102;
|
||||
};
|
||||
|
||||
if ( dayz_loadScreenMsg != "" ) then {
|
||||
_control1 ctrlSetText dayz_loadScreenMsg;
|
||||
dayz_loadScreenMsg = "";
|
||||
};
|
||||
|
||||
_control2 ctrlSetText format["%1",round(diag_tickTime - _timeOut)];
|
||||
};
|
||||
|
||||
//_timeOut = _timeOut + 1;
|
||||
uiSleep 0.001;
|
||||
};
|
||||
if (diag_tickTime >= (_timeOut + 120)) then {
|
||||
1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
|
||||
uiSleep 10;
|
||||
endLoadingScreen;
|
||||
endMission "END1";
|
||||
};
|
||||
};
|
||||
*/
|
||||
dayz_meleeMagazineCheck = {
|
||||
//private["_meleeNum","_magType","_wpnType","_ismelee"];
|
||||
_wpnType = primaryWeapon player;
|
||||
@@ -746,13 +523,10 @@ if (!isDedicated) then {
|
||||
|
||||
dayz_rollingMessages = {
|
||||
if ((diag_ticktime - Message_1_time) < 5) then {
|
||||
if ((time - Message_2_time) < 5) then
|
||||
{
|
||||
if ((time - Message_2_time) < 5) then {
|
||||
Message_3 = Message_2;
|
||||
Message_3_time = Message_2_time;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Message_3 = "";
|
||||
};
|
||||
|
||||
@@ -770,7 +544,14 @@ if (!isDedicated) then {
|
||||
|
||||
dayz_originalPlayer = player;
|
||||
|
||||
progressLoadingScreen 0.8;
|
||||
// trader menu code
|
||||
if (DZE_ConfigTrader) then {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuConfig.sqf";
|
||||
} else {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderMenuHive.sqf";
|
||||
};
|
||||
// recent murders menu code
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_murderMenu.sqf";
|
||||
};
|
||||
|
||||
//Both
|
||||
@@ -780,120 +561,58 @@ BIS_fnc_halo = compile preprocessFileLineNumbers "\z\addons\dayz_co
|
||||
BIS_fnc_findNestedElement = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_findNestedElement.sqf";
|
||||
BIS_fnc_param = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_param.sqf";
|
||||
BIS_fnc_relativeDirTo = compile("private '_dir';_dir=_this call{" + (preprocessFileLineNumbers "ca\modules\Functions\geometry\fn_relativeDirTo.sqf")+"};if(_dir>180)then{_dir=_dir-360;};if(_dir<-180)then{_dir=_dir+360;};_dir");
|
||||
fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
|
||||
zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_initialize.sqf";
|
||||
|
||||
// object_vehicleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_vehicleKilled.sqf"; //Event handler run on damage
|
||||
object_setHitServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHitServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
|
||||
object_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
|
||||
object_getHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_getHit.sqf"; //gets the hit value for a HitPoint (i.e. HitLegs) against the selection (i.e. "legs"), returns the value
|
||||
object_setHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
|
||||
object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records && sets hit)
|
||||
object_delLocal = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
|
||||
// object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player || server to monitor changes in cargo contents
|
||||
object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records and sets hit)
|
||||
//object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player or server to monitor changes in cargo contents
|
||||
object_setHitServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHitServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
|
||||
object_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
|
||||
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage
|
||||
fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle
|
||||
// Vehicle damage fix
|
||||
vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
|
||||
vehicle_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
|
||||
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
|
||||
fnc_veh_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleDam.sqf";
|
||||
fnc_veh_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleKilled.sqf";
|
||||
fnc_veh_handleRepair = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleRepair.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
|
||||
fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle
|
||||
fnc_veh_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
|
||||
local_setFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
|
||||
player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
|
||||
|
||||
//fnc_vehicleEventHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\vehicle_init.sqf"; //Initialize vehicle
|
||||
fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";
|
||||
fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
|
||||
fnc_isInsideBuilding2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding2.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding2;
|
||||
fnc_isInsideBuilding3 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding3.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding3;
|
||||
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 (|| local to unit) when gutting an object
|
||||
local_lockUnlock = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf"; //When vehicle is local to unit perform locking vehicle
|
||||
local_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf"; //Generated on the server (|| local to unit) when gutting an object
|
||||
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_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage
|
||||
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 || server to monitor whether they have picked up a new weapon
|
||||
curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
|
||||
//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";
|
||||
player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
|
||||
//player_medInject = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf";
|
||||
player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
|
||||
player_medTransfuse = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
|
||||
player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
|
||||
player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
|
||||
player_medAntiBiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medAntibiotics.sqf";
|
||||
player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
|
||||
player_projectileNear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_projectileNear.sqf";
|
||||
player_bloodCalc = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\bloodCalc.sqf";
|
||||
fn_selectRandomLocation = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandomLocation.sqf";
|
||||
fn_chance = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandomChance.sqf";
|
||||
fn_niceSpot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_niceSpot.sqf";
|
||||
fnc_Obj_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\obj_handleDam.sqf";
|
||||
object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
|
||||
player_medEpi = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medEpi.sqf";
|
||||
player_medTransfuse = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
|
||||
player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
|
||||
player_breaklegs = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBreakLegs.sqf";
|
||||
player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
|
||||
world_isDay = {if ((daytime < (24 - dayz_sunRise)) && (daytime > dayz_sunRise)) then {true} else {false}};
|
||||
player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf";
|
||||
spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf";
|
||||
spawn_loot_small = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf";
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\traps\init.sqf";
|
||||
// pseudo random for plantSpanwer
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\psrnd.sqf";
|
||||
FNC_GetPlayerUID = {
|
||||
private ["_object","_version","_PID"];
|
||||
_object = _this select 0;
|
||||
_version = productVersion select 3;
|
||||
if (DayZ_UseSteamID) then {
|
||||
_PID = GetPlayerUID _object;
|
||||
} else {
|
||||
if (_version >= 125548) then {
|
||||
_PID = call (compile "GetPlayerUIDOld _object");
|
||||
} else {
|
||||
_PID = GetPlayerUID _object;
|
||||
diag_log format["Your game version, %1, is less than the required for the old UID system; using Steam ID system instead. Update to 1.63.125548 (or latest steam beta)", _version];
|
||||
};
|
||||
};
|
||||
_PID;
|
||||
};
|
||||
FNC_GetSetPos = { //DO NOT USE IF YOU NEED ANGLE COMPENSATION!!!!
|
||||
private "_pos";
|
||||
_thingy = _this select 0;
|
||||
_pos = getPosASL _thingy;
|
||||
if (surfaceIsWater _pos) then {
|
||||
_thingy setPosASL _pos;
|
||||
} else {
|
||||
_thingy setPosATL (ASLToATL _pos);
|
||||
};
|
||||
};
|
||||
FNC_GetPos = {
|
||||
private "_pos";
|
||||
if (isNil {_this select 0}) exitWith {[0,0,0]};
|
||||
_thingy = _this select 0;
|
||||
_pos = getPosASL _thingy;
|
||||
if !(surfaceIsWater _pos) then {
|
||||
_pos = ASLToATL _pos;
|
||||
};
|
||||
_pos
|
||||
};
|
||||
local_setFuel = {
|
||||
private["_qty","_vehicle"];
|
||||
_vehicle = _this select 0;
|
||||
_qty = _this select 1;
|
||||
_vehicle setFuel _qty;
|
||||
};
|
||||
|
||||
dayz_EjectPlayer = {
|
||||
// check if player in vehicle
|
||||
private ["_noDriver","_vehicle","_inVehicle"];
|
||||
_vehicle = vehicle player;
|
||||
_inVehicle = (_vehicle != player);
|
||||
if(_inVehicle) then {
|
||||
_noDriver = ((_vehicle emptyPositions "driver") > 0);
|
||||
if (_noDriver && (speed _vehicle) != 0) then {
|
||||
player action [ "eject", _vehicle];
|
||||
};
|
||||
};
|
||||
};
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\traps\init.sqf";
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\psrnd.sqf"; // pseudo random for plantSpanwer
|
||||
|
||||
// EPOCH ADDITIONS
|
||||
local_lockUnlock = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf"; //When vehicle is local to unit perform locking vehicle
|
||||
local_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf"; //Generated on the server (or local to unit) when gutting an object
|
||||
FNC_GetPlayerUID = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fnc_getPlayerUID.sqf";
|
||||
FNC_GetSetPos = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fnc_getSetPos.sqf";
|
||||
FNC_GetPos = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fnc_getPos.sqf";
|
||||
dayz_EjectPlayer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_ejectPlayer.sqf";
|
||||
|
||||
player_sumMedical = {
|
||||
private["_character","_wounds","_legs","_arms","_medical","_status"];
|
||||
@@ -902,7 +621,7 @@ player_sumMedical = {
|
||||
if (_character getVariable["USEC_injured",false]) then {
|
||||
{
|
||||
_status = _character getVariable["hit_"+_x,false];
|
||||
if ((typeName _status == "BOOLEAN") AND {(_status)}) then {
|
||||
if ((typeName _status == "BOOLEAN") && {(_status)}) then {
|
||||
_wounds set [count _wounds,_x];
|
||||
};
|
||||
} forEach USEC_typeOfWounds;
|
||||
@@ -937,14 +656,12 @@ init_keyboard = {
|
||||
|
||||
dayz_reduceItems = {
|
||||
private ["_item","_class","_amount","_qtyRemaining"];
|
||||
//Item in current inventory.
|
||||
_item = _this select 0;
|
||||
//Class type to use.
|
||||
_class = _this select 1;
|
||||
|
||||
_item = _this select 0; //Item in current inventory.
|
||||
_class = _this select 1; //Class type to use.
|
||||
|
||||
//Does player have the original item? (Not Really needed player_useMeds checks)
|
||||
if (_item IN magazines player) exitWith {
|
||||
|
||||
if (_item in magazines player) exitWith {
|
||||
//Amount in current box (will be -1 for a random chance to start the reducing)
|
||||
_amount = getNumber(configfile >> "CfgMagazines" >> _item >> _class >> "amount");
|
||||
|
||||
@@ -973,10 +690,9 @@ dayz_inflame = {
|
||||
_object = _this select 0;
|
||||
// true = light the fire
|
||||
if (_this select 1) then {
|
||||
|
||||
_hasTool = false;
|
||||
{
|
||||
if (_x IN items player) exitWith {
|
||||
if (_x in items player) exitWith {
|
||||
_matches = getNumber(configfile >> "cfgWeapons" >> _x >> "Ignators" >> "matches");
|
||||
_qtyRemaining = getText(configfile >> "cfgWeapons" >> _x >> "Ignators" >> "qtyRemaining");
|
||||
|
||||
@@ -1014,10 +730,10 @@ dayz_inflame_showMenu = {
|
||||
_hasTool = false;
|
||||
if (!_islit) then {
|
||||
{
|
||||
if (_x IN items player) exitWith { _hasTool = true; };
|
||||
if (_x in items player) exitWith { _hasTool = true; };
|
||||
} count Dayz_Ignators;
|
||||
};
|
||||
_ret = (_whatIwant and !_islit and _hasTool) or (!_whatIwant and _isLit);
|
||||
_ret = (_whatIwant && !_islit && _hasTool) or (!_whatIwant && _isLit);
|
||||
|
||||
_ret
|
||||
};
|
||||
@@ -1038,7 +754,7 @@ dayz_inflame_other = {
|
||||
|
||||
_hasTool = false;
|
||||
{
|
||||
if (_x IN items player) exitWith {
|
||||
if (_x in items player) exitWith {
|
||||
_matches = getNumber(configfile >> "cfgWeapons" >> _x >> "Ignators" >> "matches");
|
||||
_qtyRemaining = getText(configfile >> "cfgWeapons" >> _x >> "Ignators" >> "qtyRemaining");
|
||||
|
||||
@@ -1074,33 +790,31 @@ dayz_inflame_showMenu_other = {
|
||||
// return a boolean. true <=> player can put out the lit fire, can light a fire with match
|
||||
_flame = nearestObjects [_fireplace, ["flamable_DZ"], 1];
|
||||
_flame = if (count _flame > 0) then { _flame select 0 } else { objNull };
|
||||
_islit = !(isNull _flame) and {(inflamed _flame)};
|
||||
_islit = !(isNull _flame) && {(inflamed _flame)};
|
||||
_hasTool = false;
|
||||
if (!_islit) then {
|
||||
{
|
||||
if (_x IN items player) exitWith { _hasTool = true; };
|
||||
if (_x in items player) exitWith { _hasTool = true; };
|
||||
} count Dayz_Ignators;
|
||||
};
|
||||
_ret = (_whatIwant and !_islit and _hasTool) or (!_whatIwant and _isLit);
|
||||
_ret = (_whatIwant && !_islit && _hasTool) or (!_whatIwant && _isLit);
|
||||
//systemChat str [_flame, _hasTool, _islit, _ret];
|
||||
|
||||
_ret
|
||||
};
|
||||
|
||||
isInflamed = {
|
||||
private [ "_flame" ];
|
||||
private "_flame";
|
||||
|
||||
_flame = nearestObjects [_this, ["flamable_DZ"], 1];
|
||||
_flame = if (count _flame > 0) then { _flame select 0 } else { objNull };
|
||||
!(isNull _flame) and {(inflamed _flame)}
|
||||
!(isNull _flame) && {(inflamed _flame)}
|
||||
};
|
||||
|
||||
//Matchbox combine system.
|
||||
dayz_combine_Inventory = {
|
||||
private ["_qty","_fullBox","_remain"];
|
||||
|
||||
//ItemMatchbox,ItemAntibiotic
|
||||
|
||||
_qty = 0;
|
||||
{
|
||||
if (configName inheritsFrom (configfile >> "cfgWeapons" >> _x) == "ItemMatchbox") then {
|
||||
@@ -1134,18 +848,3 @@ dayz_engineSwitch = {
|
||||
publicVariableServer "PVDZ_send";
|
||||
};
|
||||
};
|
||||
|
||||
init_keyboard = {
|
||||
waituntil {!(isNull (findDisplay 46))};
|
||||
keyboard_keys = nil;
|
||||
[controlNull, 1, false,false,false] call compile preprocessFileLineNumbers (MISSION_ROOT+'keyboard.sqf');
|
||||
};
|
||||
/*
|
||||
//Server Only
|
||||
if (isServer) then {
|
||||
call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
|
||||
} else {
|
||||
eh_localCleanup = {};
|
||||
};
|
||||
*/
|
||||
initialized = true;
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//"usecMorphine" addPublicVariableEventHandler {(_this select 1) call player_medMorphine};
|
||||
//"usecPainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller};
|
||||
"PVDZE_plr_Hit" addPublicVariableEventHandler {(_this select 1) call fnc_usec_damageHandler};
|
||||
"PVDZE_plr_HitV" addPublicVariableEventHandler {(_this select 1) call fnc_usec_damageVehicle};
|
||||
//"usecBreakLegs" addPublicVariableEventHandler {(_this select 1) call player_breaklegs};
|
||||
"PVDZ_hlt_Bleed" addPublicVariableEventHandler {(_this select 1) spawn fnc_usec_damageBleed};
|
||||
"PVDZ_veh_SF" addPublicVariableEventHandler {(_this select 1) call fnc_veh_handleRepair}; // repair a part from a vehicle
|
||||
@@ -23,13 +22,11 @@
|
||||
"PVDZE_veh_Lock" addPublicVariableEventHandler {(_this select 1) spawn local_lockUnlock};
|
||||
"PVCDZE_obj_GutBody" addPublicVariableEventHandler {(_this select 1) spawn local_gutObject};
|
||||
"PVDZE_plr_GutBodyZ" addPublicVariableEventHandler {(_this select 1) spawn local_gutObjectZ};
|
||||
"PVDZE_plr_DelLocal" addPublicVariableEventHandler {(_this select 1) call object_delLocal};
|
||||
"PVDZE_veh_Init" addPublicVariableEventHandler {(_this select 1) call fnc_veh_ResetEH};
|
||||
//"PVDZE_plr_HumanityChange" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
|
||||
"PVDZE_serverObjectMonitor" addPublicVariableEventHandler {PVDZE_serverObjectMonitor = dayz_safety};
|
||||
/* PVS/PVC - Skaronator */
|
||||
"PVCDZE_veh_SH" addPublicVariableEventHandler {(_this select 1) call vehicle_handleDamage}; // set damage to vehicle part
|
||||
"PVCDZE_veh_SF" addPublicVariableEventHandler {(_this select 1) call fnc_veh_handleDam}; // set damage to vehicle part
|
||||
"PVCDZE_veh_SH" addPublicVariableEventHandler {(_this select 1) call fnc_veh_handleDam}; // set damage to vehicle part
|
||||
|
||||
//reset OpenTarget timer
|
||||
"PVCDZE_OpenTarget_Reset" addPublicVariableEventHandler { OpenTarget_Time = diag_tickTime; };
|
||||
@@ -335,10 +332,9 @@ if (!isDedicated) then {
|
||||
};
|
||||
"PVDZE_plr_SetSaveTime" addPublicVariableEventHandler {DZE_SaveTime = (_this select 1)};
|
||||
"PVDZE_obj_RoadFlare" addPublicVariableEventHandler {(_this select 1) spawn object_roadFlare};
|
||||
"PVDZE_plr_Morph2" addPublicVariableEventHandler {(_this select 1) call player_serverModelChange};
|
||||
"PVDZE_plr_Morph" addPublicVariableEventHandler {(_this select 1) call server_switchPlayer};
|
||||
"PVDZE_obj_Fire" addPublicVariableEventHandler {nulexp=(_this select 1) spawn BIS_Effects_Burn};
|
||||
"PVDZE_plr_FriendRQ" addPublicVariableEventHandler {(_this select 1) call player_tagFriendlyMsg};
|
||||
"PVDZE_plr_FriendRQ" addPublicVariableEventHandler {if (player == ((_this select 1) select 0)) then {cutText[localize "str_epoch_player_2","PLAIN DOWN"];};};
|
||||
"PVDZ_drg_RaDrag" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"};
|
||||
"PVDZ_dayzFlies" addPublicVariableEventHandler {(_this select 1) call spawn_flies};
|
||||
//Medical
|
||||
@@ -350,8 +346,6 @@ if (!isDedicated) then {
|
||||
"PVCDZ_hlt_PainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller};
|
||||
"PVCDZ_hlt_AntiB" addPublicVariableEventHandler {(_this select 1) call player_medAntiBiotics};
|
||||
|
||||
// "PVDZE_obj_Debris" addPublicVariableEventHandler {(_this select 1) call local_roadDebris};
|
||||
|
||||
"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"};
|
||||
"PVCDZ_plr_Humanity" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
|
||||
|
||||
Reference in New Issue
Block a user