+ 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.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, "",""];
s_player_repairActions set [count s_player_repairActions,_handle];
};

View File

@@ -19,16 +19,26 @@ if (_hasToolbox) then {
_vehicle removeAction _id;
//dont allow removal of damaged parts
if (_damage < 0.15) then {
if (_damage < 1) then {
_isOK = [player,_part] call BIS_fnc_invAdd;
if (_isOK) then {
//Fix the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
// 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
_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");
//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;
player playActionNow "Medic";
@@ -39,9 +49,15 @@ if (_hasToolbox) then {
sleep 5;
_vehicle setvelocity [0,0,1];
//Success!
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
if(ceil (random _findPercent) == 1) then {
// 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 {
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
if (_damage < 0.25) then {
if (_damage < 1) then {
// Do not allow removal of engine or fueltanks
if( _part == "PartGlass" or _part == "PartWheel" ) then {
_color = "color='#ff0000'"; //red
_string = format["<t %2>Remove%1</t>",_cmpt,_color]; //Remove - Part
_color = "color='#ffff00'"; //yellow
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, "",""];
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;
_veh call fnc_vehicleEventHandler;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
// Sell Vehicle

View File

@@ -55,13 +55,16 @@ if (_qty >= _qty_in) then {
player reveal _veh;
_location = getPosATL _veh;
_veh setVariable ["characterID",dayz_playerUID,true];
//_veh setVariable ["characterID",dayz_playerUID,true];
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
["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"];
} else {
// Sell Vehicle
@@ -75,7 +78,7 @@ if (_qty >= _qty_in) then {
["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;
deleteVehicle _obj;
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};

View File

@@ -249,6 +249,109 @@ class Citizen1; // External class reference
transportmaxbackpacks = 2;
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
{
scope = 2;

View File

@@ -217,12 +217,15 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 6))
if (_ownerID == dayz_playerUID) then {
if (s_player_unlockvault < 0) then {
s_player_unlockvault = player addAction ["Unlock Vault", "\z\addons\dayz_code\actions\vault_unlock.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
};
} else {
if(_hasToolbox) 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, "",""];
};
} else {
player removeAction s_player_unlockvault;
s_player_unlockvault = -1;
};
};

View File

@@ -1,28 +1,30 @@
private["_item","_qty","_type","_meat","_loop"];
_item = _this select 0;
private["_animalbody","_qty","_rawfoodtype","_ehLoc"];
_animalbody = _this select 0;
_qty = _this select 1;
_type = typeOf _item;
_meat = 0;
_loop = true;
_rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> _type >> "rawfoodtype");
_rawfoodtype = getText (configFile >> "CfgSurvival" >> "Meat" >> typeOf _animalbody >> "rawfoodtype");
if (local _item) then {
if (local _animalbody) then {
for "_x" from 1 to _qty do {
_item addMagazine _rawfoodtype;
_animalbody addMagazine _rawfoodtype;
};
sleep 2;
_timer = time;
while {_loop} do {
_meat = count magazines _item;
if (_meat == 0) then {_loop = false};
if ((time - _timer) > 300) then {_loop = false};
sleep 1;
sleep 1;
[time, _animalbody] spawn {
private ["_timer", "_body"];
_timer = _this select 0;
_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 {
_ehLoc = "client";
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 removeAction s_player_unlockvault;
s_player_unlockvault = 1;
_item = "ItemToolbox";
_hasToolbox = _item in items player;
@@ -29,8 +30,10 @@ if (_ownerID == dayz_playerUID) then {
// Chance to break toolbox randomly
if(floor (random 15) == 1) then {
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;
};
cutText ["This vault has been unlocked", "PLAIN DOWN"];
cutText ["Vault has been unlocked.", "PLAIN DOWN"];
} else {
player playActionNow "Medic";
sleep 3;
@@ -111,4 +114,4 @@ if(_allowunlock) then {
cutText ["Combination incorrect, vault is still locked.", "PLAIN DOWN"];
};
s_player_unlockvault = -1;
s_player_unlockvault = -1;

View File

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

View File

@@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version
{
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)";
};
class CA_TitleMainMenu;

View File

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

View File

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

View File

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