+ formatting for damage percentage for repair and salvage.
+ Chance to break part when salvaging damaged parts.
+ Potential fix for purchased vehicle damage handler.
+ added check when cracking vault to exit when toolbox is broken
+ Potential fix for glitched extra crack vault options and no delay.
+ 1.7.5.1
This commit is contained in:
vbawol
2013-02-05 07:56:39 -06:00
parent d60007afc9
commit ca32bcbf71
14 changed files with 184 additions and 50 deletions

View File

@@ -50,7 +50,8 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
_string = format["<t %2>Repair%1</t>",_cmpt,_color]; //Repair - Part _percent = round(_damage*100);
_string = format["<t %2>Repair%1 (%3%)</t>",_cmpt,_color,_percent]; //Repair - Part
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""]; _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_repairActions set [count s_player_repairActions,_handle]; s_player_repairActions set [count s_player_repairActions,_handle];
}; };

View File

@@ -19,16 +19,26 @@ if (_hasToolbox) then {
_vehicle removeAction _id; _vehicle removeAction _id;
//dont allow removal of damaged parts //dont allow removal of damaged parts
if (_damage < 0.15) then { if (_damage < 1) then {
_isOK = [player,_part] call BIS_fnc_invAdd; _isOK = [player,_part] call BIS_fnc_invAdd;
if (_isOK) then { if (_isOK) then {
// the more damaged the part the higher the chance to loose the part.
// 0.25 = 25% chance to loose part
// 0.5 = 50% chance to loose part
// 0.75 = 75% chance to loose part
// 0.99 = 99% chance to loose part
//Fix the part _findPercent = (1 - _damage) * 10;
// X = 1 - 0.25 = 0.75 x 10 == 7.5
// X = 1 - 0.99 = 0.01 x 10 == 0.1
//break the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name"); _selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
["dayzSetFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal; ["dayzSetFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal;
player playActionNow "Medic"; player playActionNow "Medic";
@@ -39,9 +49,15 @@ if (_hasToolbox) then {
sleep 5; sleep 5;
_vehicle setvelocity [0,0,1]; _vehicle setvelocity [0,0,1];
//Success! if(ceil (random _findPercent) == 1) then {
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"]; // loose part and damage vehicle
player removeMagazine _part;
//Failed!
cutText [format["You have destroyed %1 while attempting to remove from %2",_namePart,_nameType], "PLAIN DOWN"];
} else {
//Success!
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
};
} else { } else {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"]; cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];

View File

@@ -43,13 +43,17 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
}; };
// allow removal of any lightly damaged parts // allow removal of any lightly damaged parts
if (_damage < 0.25) then { if (_damage < 1) then {
// Do not allow removal of engine or fueltanks // Do not allow removal of engine or fueltanks
if( _part == "PartGlass" or _part == "PartWheel" ) then { if( _part == "PartGlass" or _part == "PartWheel" ) then {
_color = "color='#ff0000'"; //red _color = "color='#ffff00'"; //yellow
_string = format["<t %2>Remove%1</t>",_cmpt,_color]; //Remove - Part if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
_percent = round(_damage*100);
_string = format["<t %2>Remove%1 (%3%)</t>",_cmpt,_color,_percent]; //Remove - Part
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true, "",""]; _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_repairActions set [count s_player_repairActions,_handle]; s_player_repairActions set [count s_player_repairActions,_handle];
}; };

View File

@@ -62,6 +62,8 @@ if (_qty >= _qty_in) then {
["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure; ["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
_veh call fnc_vehicleEventHandler;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"]; cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else { } else {
// Sell Vehicle // Sell Vehicle

View File

@@ -55,13 +55,16 @@ if (_qty >= _qty_in) then {
player reveal _veh; player reveal _veh;
_location = getPosATL _veh; _location = getPosATL _veh;
_veh setVariable ["characterID",dayz_playerUID,true]; //_veh setVariable ["characterID",dayz_playerUID,true];
clearWeaponCargoGlobal _veh; clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh; clearMagazineCargoGlobal _veh;
["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure; ["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
// check if this will add the needed event handlers to correctly track damage client side
_veh call fnc_vehicleEventHandler;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"]; cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else { } else {
// Sell Vehicle // Sell Vehicle

View File

@@ -249,6 +249,109 @@ class Citizen1; // External class reference
transportmaxbackpacks = 2; transportmaxbackpacks = 2;
class Turrets {}; class Turrets {};
}; };
class HMMWV_Base;
class HMMWV_DZ: HMMWV_Base {
accuracy = 0.32;
displayname = "HMMWV_DZ";
hasgunner = 0;
hiddenselections[] = {"Camo1"};
hiddenselectionstextures[] = {"\ca\wheeled\hmmwv\data\hmmwv_body_co.paa"};
icon = "\Ca\wheeled\data\map_ico\icomap_hmwv_CA.paa";
mapsize = 5;
model = "ca\wheeled_E\HMMWV\HMMWV";
picture = "\Ca\wheeled\data\ico\HMMWV_CA.paa";
scope = 2;
side = 2;
crew = "";
typicalCargo[] = {};
transportMaxWeapons = 4;
transportMaxMagazines = 12;
transportmaxbackpacks = 4;
class Turrets {};
class HitPoints {
class HitEngine {
armor = 2.4;
material = -1;
name = "motor";
passthrough = 0.2;
visual = "";
};
class HitBody {
armor = 1;
material = -1;
name = "karoserie";
passthrough = 1;
visual = "";
};
class HitFuel {
armor = 1.3;
material = -1;
name = "palivo";
passthrough = 0.5;
visual = "";
};
class HitLFWheel {
armor = 0.30;
material = -1;
name = "wheel_1_1_steering";
passthrough = 0.3;
visual = "";
};
class HitRFWheel {
armor = 0.30;
material = -1;
name = "wheel_2_1_steering";
passthrough = 0.3;
visual = "";
};
class HitLBWheel {
armor = 0.30;
material = -1;
name = "wheel_1_2_steering";
passthrough = 0.3;
visual = "";
};
class HitRBWheel {
armor = 0.30;
material = -1;
name = "wheel_2_2_steering";
passthrough = 0.3;
visual = "";
};
class HitGlass1 {
armor = 0.4;
material = -1;
name = "glass1";
passthrough = 0;
visual = "glass1";
};
class HitGlass2 {
armor = 0.4;
material = -1;
name = "glass2";
passthrough = 0;
visual = "glass2";
};
class HitGlass3 {
armor = 0.2;
material = -1;
name = "glass3";
passthrough = 0;
visual = "glass3";
};
class HitGlass4 {
armor = 0.2;
material = -1;
name = "glass4";
passthrough = 0;
visual = "glass4";
};
};
class Damage {
mat[] = {"ca\wheeled\hmmwv\data\hmmwv_details.rvmat", "Ca\wheeled\HMMWV\data\hmmwv_details_damage.rvmat", "Ca\wheeled\HMMWV\data\hmmwv_details_destruct.rvmat", "ca\wheeled\hmmwv\data\hmmwv_body.rvmat", "Ca\wheeled\HMMWV\data\hmmwv_body_damage.rvmat", "Ca\wheeled\HMMWV\data\hmmwv_body_destruct.rvmat", "ca\wheeled\hmmwv\data\hmmwv_clocks.rvmat", "ca\wheeled\hmmwv\data\hmmwv_clocks.rvmat", "ca\wheeled\data\hmmwv_clocks_destruct.rvmat", "ca\wheeled\HMMWV\data\hmmwv_glass.rvmat", "ca\wheeled\HMMWV\data\hmmwv_glass_Half_D.rvmat", "ca\wheeled\HMMWV\data\hmmwv_glass_Half_D.rvmat", "ca\wheeled\HMMWV\data\hmmwv_glass_in.rvmat", "ca\wheeled\HMMWV\data\hmmwv_glass_in_Half_D.rvmat", "ca\wheeled\HMMWV\data\hmmwv_glass_in_Half_D.rvmat"};
tex[] = {};
};
};
class MH6J_DZ: AH6_Base_EP1 class MH6J_DZ: AH6_Base_EP1
{ {
scope = 2; scope = 2;

View File

@@ -223,6 +223,9 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6))
if (s_player_unlockvault < 0) then { if (s_player_unlockvault < 0) then {
s_player_unlockvault = player addAction ["Crack Vault", "\z\addons\dayz_code\actions\vault_unlock.sqf",cursorTarget, 0, false, true, "",""]; s_player_unlockvault = player addAction ["Crack Vault", "\z\addons\dayz_code\actions\vault_unlock.sqf",cursorTarget, 0, false, true, "",""];
}; };
} else {
player removeAction s_player_unlockvault;
s_player_unlockvault = -1;
}; };
}; };

View File

@@ -1,28 +1,30 @@
private["_item","_qty","_type","_meat","_loop"]; private["_animalbody","_qty","_rawfoodtype","_ehLoc"];
_item = _this select 0; _animalbody = _this select 0;
_qty = _this select 1; _qty = _this select 1;
_type = typeOf _item; _rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> typeOf _animalbody >> "rawfoodtype");
_meat = 0;
_loop = true;
_rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> _type >> "rawfoodtype");
if (local _item) then { if (local _animalbody) then {
for "_x" from 1 to _qty do { for "_x" from 1 to _qty do {
_item addMagazine _rawfoodtype; _animalbody addMagazine _rawfoodtype;
}; };
sleep 2;
_timer = time; sleep 1;
while {_loop} do {
_meat = count magazines _item; [time, _animalbody] spawn {
if (_meat == 0) then {_loop = false}; private ["_timer", "_body"];
if ((time - _timer) > 300) then {_loop = false}; _timer = _this select 0;
sleep 1; _body = _this select 1;
while {(count magazines _body >0) and (time - _timer < 300) } do {
sleep 5;
};
["dayzHideBody",_body] call broadcastRpcCallAll;
sleep 5;
deleteVehicle _body;
true;
}; };
["dayzHideBody",_item] call broadcastRpcCallAll;
sleep 10;
deleteVehicle _item;
} else { } else {
_ehLoc = "client"; _ehLoc = "client";
if (isServer) then { _ehLoc = "server"; }; if (isServer) then { _ehLoc = "server"; };
diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_item)]; diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_animalbody)];
}; };

View File

@@ -9,6 +9,7 @@ _objectUID = _obj getVariable["ObjectUID","0"];
player playActionNow "Medic"; player playActionNow "Medic";
player removeAction s_player_unlockvault; player removeAction s_player_unlockvault;
s_player_unlockvault = 1;
_item = "ItemToolbox"; _item = "ItemToolbox";
_hasToolbox = _item in items player; _hasToolbox = _item in items player;
@@ -29,8 +30,10 @@ if (_ownerID == dayz_playerUID) then {
// Chance to break toolbox randomly // Chance to break toolbox randomly
if(floor (random 15) == 1) then { if(floor (random 15) == 1) then {
player removeWeapon _item; player removeWeapon _item;
cutText ["Your toolbox is now broken, you will need to find another one.", "PLAIN DOWN"]; titleText ["Your toolbox is now broken, you will need to find another one.", "PLAIN"];
}; };
} else {
if (!_hasToolbox) exitWith {cutText ["Cannot crack vault, you do not have a Tool Box." , "PLAIN"]};
}; };
}; };
@@ -101,7 +104,7 @@ if(_allowunlock) then {
} forEach _objWpnTypes; } forEach _objWpnTypes;
}; };
cutText ["This vault has been unlocked", "PLAIN DOWN"]; cutText ["Vault has been unlocked.", "PLAIN DOWN"];
} else { } else {
player playActionNow "Medic"; player playActionNow "Medic";
sleep 3; sleep 3;

View File

@@ -33,7 +33,7 @@ class CfgMods
hidePicture = 0; hidePicture = 0;
hideName = 0; hideName = 0;
action = "http://www.dayzepoch.com"; action = "http://www.dayzepoch.com";
version = "0.916"; version = "0.92";
hiveVersion = 0.96; //0.93 hiveVersion = 0.96; //0.93
}; };
}; };

View File

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

View File

@@ -127,7 +127,7 @@ _object setDamage _damage;
_object setvelocity [0,0,1]; _object setvelocity [0,0,1];
_object setFuel _fuel; _object setFuel _fuel;
_id = _object spawn fnc_vehicleEventHandler; _object call fnc_vehicleEventHandler;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object]; dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];

View File

@@ -150,11 +150,8 @@ switch (_type) do {
if ( (time - _lastUpdate) > 5) then { if ( (time - _lastUpdate) > 5) then {
call _object_damage; call _object_damage;
} else { } else {
diag_log format["DEBUG: Added to NeedUpdate=%1",_object];
if(_object not in needUpdate_objects) then { needUpdate_objects set [count needUpdate_objects, _object];
diag_log format["DEBUG: Added to NeedUpdate=%1",_object];
needUpdate_objects set [count needUpdate_objects, _object];
};
}; };
}; };
case "killed": { case "killed": {

View File

@@ -98,7 +98,7 @@ diag_log "HIVE: Starting";
clearWeaponCargoGlobal _object; clearWeaponCargoGlobal _object;
clearMagazineCargoGlobal _object; clearMagazineCargoGlobal _object;
if (_object isKindOf "TentStorage" or _object isKindOf "VaultStorageLocked") then { if (_object isKindOf "TentStorage") then {
_pos set [2,0]; _pos set [2,0];
_object setpos _pos; _object setpos _pos;
_object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}]; _object addMPEventHandler ["MPKilled",{_this call vehicle_handleServerKilled;}];