0.998 released

Final testing started on 0.998. Patch notes so far:
+ Crafting now only requires a fire within 2m.
+ Safe should now drop items on ground when packed.
+ Changed humanity gains/losses based on player death so that humanity
is accounted for.
+ Fixed broken humanity hit and freetarget with player damage since
1.7.6.1.
+ Potential fix for swimming in ground.
+ !isNull and Distance checks for player zombie "feed" option.
+ Added open crate option for supply crates. Requires crowbar in
toolbelt.
+ fixed Auto Refueling Station (Dingor) #234
+ Added new pink clothes option to loot tables.
+ Added medic animation to complete trades to selling/buying weapons,
toolbelt items, backpacks, and vehicles.
+ Added medic animation to complete siphon, refueling, and fill jerry.
+ Changed number of possible siphon and refuel is based on quantity of
empty or full jerry cans.
+ Changed Player zombies V or getover animation to walkforward instead
of sitdown. This will cause the player to be stuck walking until an
attack is issued.
+ Fixed serveral lingor/dingor buildings that had incorrect classnames
in loot tables causing no loot to spawn with more recent builds.
+ Added a few building loot spawns for tavi 1.0
+ updated server SQL with latest copy from server.
This commit is contained in:
vbawol
2013-03-23 14:46:22 -05:00
parent 832d44ed13
commit 11cb1c820c
17 changed files with 2818 additions and 892 deletions

View File

@@ -3,26 +3,75 @@ private["_hasFood","_item","_text","_qty"];
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
_fillCounter = 0;
_abort = false;
_qty = {_x == "ItemJerrycanEmpty"} count magazines player;
if ("ItemJerrycanEmpty" in magazines player) then {
for "_x" from 1 to _qty do {
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
};
//disableSerialization;
//call dayz_forceSave;
for "_x" from 1 to _qty do {
_fillCounter = _fillCounter + 1;
if(_siphonQty == 1) then {
cutText ["Preparing to siphon, stand still to fill empty jerry can.", "PLAIN DOWN"];
} else {
cutText [format[("Preparing to siphon, stand still to fill empty jerry can %1 of %2."),_fillCounter,_siphonQty] , "PLAIN DOWN"];
};
// force animation
player playActionNow "Medic";
// Play sound and alert zombies
_dis=10;
_sfx = "refuel";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
cutText [format[(localize "str_player_09"),_qty], "PLAIN DOWN"];
} else {
cutText [(localize "str_player_10") , "PLAIN DOWN"];
if (!_finished) exitWith {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled siphon." , "PLAIN DOWN"];
_abort = true;
};
if (_finished) then {
if ("ItemJerrycanEmpty" in magazines player) then {
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
cutText [format[(localize "str_player_09"),1], "PLAIN DOWN"];
} else {
cutText [(localize "str_player_10") , "PLAIN DOWN"];
_abort = true;
};
};
sleep 1;
if(_abort) exitWith {};
};

View File

@@ -29,7 +29,7 @@ if ((_location select 2) < 0) then {
player removeMagazine _item;
_dir = getDir player;
_classname = "CardboardBox";
_classname = "WeaponHolder";
// Change to optional wait to complete
player playActionNow "Medic";

View File

@@ -1,42 +1,97 @@
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
_vehicle = cursorTarget;
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not refuel while someone is in the vehicle", "PLAIN DOWN"]};
_fillCounter = 0;
_abort = false;
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_capacity = getNumber(_configVeh >> "fuelCapacity");
_nameType = getText(_configVeh >> "displayName");
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel + _canSize);
if (_newFuel > _capacity) then {_newFuel = _capacity};
_newFuel = (_newFuel / _capacity);
player removeMagazine "ItemJerrycan";
player addMagazine "ItemJerrycanEmpty";
//disableSerialization;
//call dayz_forceSave;
player playActionNow "Medic";
_dis=10;
_sfx = "refuel";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
dayzSetFuel = [_vehicle,_newFuel];
publicVariable "dayzSetFuel";
if (local _vehicle) then {
dayzSetFuel spawn local_setFuel;
};
cutText [format[localize "str_player_05",_nameType,_canSize], "PLAIN DOWN"];
// Get number of full jerry cans
_refuelQty = {_x == "ItemJerrycan"} count magazines player;
sleep 1;
// attempt to refuel for each empty jerry can
for "_x" from 1 to _refuelQty do {
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel + _canSize);
call fnc_usec_medic_removeActions;
r_action = false;
if (_newFuel > _capacity) exitWith {
cutText [format["%1 is full of fuel.",_nameType], "PLAIN DOWN"];
};
_newFuel = (_newFuel / _capacity);
_fillCounter = _fillCounter + 1;
if(_refuelQty == 1) then {
cutText ["Preparing to refuel, stand still to fill empty jerry can.", "PLAIN DOWN"];
} else {
cutText [format[("Preparing to refuel, stand still to drain full jerry can %1 of %2."),_fillCounter,_refuelQty] , "PLAIN DOWN"];
};
// force animation
player playActionNow "Medic";
// Play sound and alert zombies
[player,"refuel",0,false] call dayz_zombieSpeak;
[player,20,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (!_finished) exitWith {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled refuel." , "PLAIN DOWN"];
_abort = true;
};
if (_finished) then {
if ("ItemJerrycan" in magazines player) then {
player removeMagazine "ItemJerrycan";
player addMagazine "ItemJerrycanEmpty";
dayzSetFuel = [_vehicle,_newFuel];
publicVariable "dayzSetFuel";
if (local _vehicle) then {
dayzSetFuel spawn local_setFuel;
};
cutText [format[localize "str_player_05",_nameType,_canSize], "PLAIN DOWN"];
call fnc_usec_medic_removeActions;
r_action = false;
sleep 1;
} else {
_abort = true;
};
};
if(_abort) exitWith {};
};

View File

@@ -1,51 +1,105 @@
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
_vehicle = cursorTarget;
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not sihpon fuel while someone is in the vehicle", "PLAIN DOWN"]};
_fillCounter = 0;
_abort = false;
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_capacity = getNumber(_configVeh >> "fuelCapacity");
_nameType = getText(_configVeh >> "displayName");
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel - _canSize);
// calculate minimum needed fuel
_newFuel = (_newFuel / _capacity);
// Get number of empty jerry cans
_siphonQty = {_x == "ItemJerrycanEmpty"} count magazines player;
if (_newFuel > 0) then {
// attempt to siphon for each empty jerry can
for "_x" from 1 to _siphonQty do {
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel - _canSize);
//disableSerialization;
//call dayz_forceSave;
// calculate minimum needed fuel
_newFuel = (_newFuel / _capacity);
player playActionNow "Medic";
[player,"refuel",0,false] call dayz_zombieSpeak;
_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
//apply newFuel to vehicle on every peer
//["dayzSetFuel",[_vehicle,_newFuel]] call broadcastRpcCallAll;
dayzSetFuel = [_vehicle,_newFuel];
if (local _vehicle) then {
dayzSetFuel spawn local_setFuel;
if(_newFuel <= 0) exitWith {
cutText [format["%1 does not have enough fuel.",_nameType], "PLAIN DOWN"];
};
publicVariable "dayzSetFuel";
cutText [format["%1 has been drained for %2 litres of Fuel",_nameType,_canSize], "PLAIN DOWN"];
sleep 1;
if (_newFuel > 0) then {
call fnc_usec_medic_removeActions;
r_action = false;
_fillCounter = _fillCounter + 1;
} else {
cutText [format["%1 has no fuel.",_nameType], "PLAIN DOWN"];
if(_siphonQty == 1) then {
cutText ["Preparing to siphon, stand still to fill empty jerry can.", "PLAIN DOWN"];
} else {
cutText [format[("Preparing to siphon, stand still to fill empty jerry can %1 of %2."),_fillCounter,_siphonQty] , "PLAIN DOWN"];
};
// force animation
player playActionNow "Medic";
// Play sound and alert zombies
[player,"refuel",0,false] call dayz_zombieSpeak;
[player,20,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (!_finished) exitWith {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled siphon." , "PLAIN DOWN"];
_abort = true;
};
if (_finished) then {
if ("ItemJerrycanEmpty" in magazines player) then {
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
//apply newFuel to vehicle on every peer
//["dayzSetFuel",[_vehicle,_newFuel]] call broadcastRpcCallAll;
dayzSetFuel = [_vehicle,_newFuel];
if (local _vehicle) then {
dayzSetFuel spawn local_setFuel;
};
publicVariable "dayzSetFuel";
cutText [format["%1 has been drained for %2 litres of Fuel",_nameType,_canSize], "PLAIN DOWN"];
call fnc_usec_medic_removeActions;
r_action = false;
sleep 1;
} else {
_abort = true;
};
};
};
if(_abort) exitWith {};
};

View File

@@ -28,76 +28,118 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
cutText ["Starting trade, stand still to complete trade.", "PLAIN DOWN"];
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
waitUntil {!isNil "dayzTradeResult"};
if (!_finished) exitWith {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled Trade." , "PLAIN DOWN"];
};
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
if (_finished) then {
if(dayzTradeResult == "PASS") then {
// Double check for items
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_obj = nearestObjects [(getPosATL player), [_part_in], 20];
_qty = count _obj;
};
if (_qty >= _qty_in) then {
if(_buy_o_sell == "buy") then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
//disableSerialization;
//call dayz_forceSave;
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
_dir = round(random 360);
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
_location = [(position player),0,20,1,2,2000,0] call BIS_fnc_findSafePos;
waitUntil {!isNil "dayzTradeResult"};
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
if(dayzTradeResult == "PASS") then {
if(_buy_o_sell == "buy") then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
_dir = round(random 360);
_location = [(position player),0,20,1,2,2000,0] call BIS_fnc_findSafePos;
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_location = (getPosATL _veh);
_location = (getPosATL _veh);
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
publicVariableServer "dayzPublishVeh2";
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
publicVariableServer "dayzPublishVeh2";
_veh call fnc_vehicleEventHandler;
_veh call fnc_vehicleEventHandler;
player reveal _veh;
player reveal _veh;
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 {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
} else {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
//disableSerialization;
//call dayz_forceSave;
_obj = _obj select 0;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
_obj = _obj select 0;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
deleteVehicle _obj;
deleteVehicle _obj;
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
};
dayzTradeResult = nil;
};
};
dayzTradeResult = nil;
} else {
_needed = _qty_in - _qty;

View File

@@ -25,87 +25,128 @@ if(_buy_o_sell == "buy") then {
_bos = 1;
};
if (_qty >= _qty_in) then {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
cutText ["Starting trade, stand still to complete trade.", "PLAIN DOWN"];
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
waitUntil {!isNil "dayzTradeResult"};
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
if(dayzTradeResult == "PASS") then {
if(_buy_o_sell == "buy") then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
//disableSerialization;
//call dayz_forceSave;
_dir = round(random 360);
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
if(count _helipad > 0) then {
_location = (getPosATL (_helipad select 0));
} else {
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_location = (getPosATL _veh);
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
publicVariableServer "dayzPublishVeh2";
// event handlers to correctly track damage client side
_veh call fnc_vehicleEventHandler;
player reveal _veh;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
//disableSerialization;
//call dayz_forceSave;
_obj = _obj select 0;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
deleteVehicle _obj;
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (!_finished) exitWith {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled Trade." , "PLAIN DOWN"];
};
if (_finished) then {
// Double check for items
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_obj = nearestObjects [(getPosATL player), [_part_in], 20];
_qty = count _obj;
_bos = 1;
};
if (_qty >= _qty_in) then {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
waitUntil {!isNil "dayzTradeResult"};
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
if(dayzTradeResult == "PASS") then {
if(_buy_o_sell == "buy") then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
_dir = round(random 360);
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
if(count _helipad > 0) then {
_location = (getPosATL (_helipad select 0));
} else {
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
};
//place vehicle spawn marker (local)
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
_location = (getPosATL _veh);
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
publicVariableServer "dayzPublishVeh2";
// event handlers to correctly track damage client side
_veh call fnc_vehicleEventHandler;
player reveal _veh;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
_obj = _obj select 0;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
deleteVehicle _obj;
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
};
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
};
dayzTradeResult = nil;
};
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
};
dayzTradeResult = nil;
} else {
_needed = _qty_in - _qty;

View File

@@ -15,18 +15,10 @@ _textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7;
_bos = 0;
_bulkqty = 0;
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
// SELL ONLY check if item is bulk
_bulkItem = "bulk_" + _part_in;
_bulkqty = {_x == _bulkItem} count magazines player;
diag_log format["DEBUG bulk: %1", _bulkItem];
_bos = 1;
_qty = 0;
_bag = unitBackpack player;
@@ -36,127 +28,101 @@ if(_buy_o_sell == "buy") then {
};
};
if (_bulkqty >= 1) then {
// TODO: optimize for one db call only
_part_in = "bulk_" + _part_in;
player removeMagazine _part_in;
if (_qty >= _qty_in) then {
//disableSerialization;
//call dayz_forceSave;
cutText ["Starting trade, stand still to complete trade.", "PLAIN DOWN"];
// force animation
player playActionNow "Medic";
diag_log format["DEBUG remove magazine %1", _part_in];
// increment trader for each
for "_x" from 1 to 12 do {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
waitUntil {!isNil "dayzTradeResult"};
if(dayzTradeResult == "PASS") then {
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (!_finished) exitWith {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled Trade." , "PLAIN DOWN"];
};
_qty_out = _qty_out * 12;
if (_finished) then {
// gold = 36 copper
// gold = 6 silver
//
if (_part_out == "ItemSilverBar" and _qty_out >= 30) then {
// find number of gold
_gold_out = _qty_out / 30;
// whole number of gold bars
_gold_qty_out = floor _gold_out;
_part_out = "ItemGoldBar";
for "_x" from 1 to _gold_qty_out do {
player addMagazine _part_out;
};
// Find remainder
_partial_qty_out = (_gold_out - _gold_qty_out) * 30;
// whole number of silver bars
_silver_qty_out = floor _partial_qty_out;
_part_out = "ItemSilverBar";
for "_x" from 1 to _silver_qty_out do {
player addMagazine _part_out;
};
} else {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
};
//disableSerialization;
//call dayz_forceSave;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
dayzTradeResult = nil;
} else {
if (_qty >= _qty_in) then {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
waitUntil {!isNil "dayzTradeResult"};
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
if(dayzTradeResult == "PASS") then {
if(_buy_o_sell == "buy") then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
removeBackpack player;
player addBackpack _part_out;
} else {
// Sell
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
removeBackpack player;
// player addBackpack _part_out;
};
//disableSerialization;
//call dayz_forceSave;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
// Double check we still have parts
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
_qty = 0;
_bag = unitBackpack player;
_class = typeOf _bag;
if(_class == _part_in) then {
_qty = 1;
};
};
dayzTradeResult = nil;
if (_qty >= _qty_in) then {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
waitUntil {!isNil "dayzTradeResult"};
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
if(dayzTradeResult == "PASS") then {
if(_buy_o_sell == "buy") then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
removeBackpack player;
player addBackpack _part_out;
} else {
// Sell
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
removeBackpack player;
// player addBackpack _part_out;
};
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
};
dayzTradeResult = nil;
};
};
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -15,145 +15,109 @@ _textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7;
_bos = 0;
_bulkqty = 0;
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
// SELL ONLY check if item is bulk
_bulkItem = "bulk_" + _part_in;
_bulkqty = {_x == _bulkItem} count magazines player;
diag_log format["DEBUG bulk: %1", _bulkItem];
_qty = {_x == _part_in} count weapons player;
_bos = 1;
};
if (_bulkqty >= 1) then {
// TODO: optimize for one db call only
_part_in = "bulk_" + _part_in;
player removeMagazine _part_in;
diag_log format["DEBUG remove magazine %1", _part_in];
if (_qty >= _qty_in) then {
// increment trader for each
for "_x" from 1 to 12 do {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
waitUntil {!isNil "dayzTradeResult"};
cutText ["Starting trade, stand still to complete trade.", "PLAIN DOWN"];
// force animation
player playActionNow "Medic";
//_dis=20;
//_sfx = "repair";
//[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
//[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (!_finished) exitWith {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Canceled Trade." , "PLAIN DOWN"];
};
if (_finished) then {
// double check for all parts
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_qty = {_x == _part_in} count weapons player;
};
if (_qty >= _qty_in) then {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
waitUntil {!isNil "dayzTradeResult"};
if(dayzTradeResult == "PASS") then {
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
if(dayzTradeResult == "PASS") then {
for "_x" from 1 to _qty_in do {
if(_buy_o_sell == "buy") then {
player removeMagazine _part_in;
} else {
player removeWeapon _part_in;
};
};
for "_x" from 1 to _qty_out do {
if(_buy_o_sell == "buy") then {
player addWeapon _part_out;
} else {
player addMagazine _part_out;
};
};
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
};
dayzTradeResult = nil;
};
};
_qty_out = _qty_out * 12;
// gold = 36 copper
// gold = 6 silver
//
if (_part_out == "ItemSilverBar" and _qty_out >= 30) then {
// find number of gold
_gold_out = _qty_out / 30;
// whole number of gold bars
_gold_qty_out = floor _gold_out;
_part_out = "ItemGoldBar";
for "_x" from 1 to _gold_qty_out do {
player addMagazine _part_out;
};
// Find remainder
_partial_qty_out = (_gold_out - _gold_qty_out) * 30;
// whole number of silver bars
_silver_qty_out = floor _partial_qty_out;
_part_out = "ItemSilverBar";
for "_x" from 1 to _silver_qty_out do {
player addMagazine _part_out;
};
} else {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
};
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
//disableSerialization;
//call dayz_forceSave;
dayzTradeResult = nil;
} else {
if (_qty >= _qty_in) then {
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
publicVariableServer "dayzTradeObject";
waitUntil {!isNil "dayzTradeResult"};
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
if(dayzTradeResult == "PASS") then {
for "_x" from 1 to _qty_in do {
if(_buy_o_sell == "buy") then {
player removeMagazine _part_in;
} else {
player removeWeapon _part_in;
};
};
for "_x" from 1 to _qty_out do {
if(_buy_o_sell == "buy") then {
player addWeapon _part_out;
} else {
player addMagazine _part_out;
};
};
// [player,"repair",0,false] call dayz_zombieSpeak;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
//disableSerialization;
//call dayz_forceSave;
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
};
dayzTradeResult = nil;
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -53,7 +53,7 @@ if (_canPickLight and !dayz_hasLight and !_isPZombie) then {
s_player_removeflare = -1;
};
hint str(typeOf cursorTarget);
// hint str(typeOf cursorTarget);
if(_isPZombie) then {
//_state = animationState player;

View File

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

View File

@@ -237,8 +237,7 @@ if (!isDedicated) then {
if (_dikCode in (actionKeys "GetOver")) then {
if (player isKindOf "PZombie_VB") exitWith {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
player switchAction "walkf";
};
if (!r_fracture_legs and (time - dayz_lastCheckBit > 4)) then {
_inBuilding = [player] call fnc_isInsideBuilding;

View File

@@ -8,7 +8,7 @@ fnc_usec_damageHandle = {
_unit = _this select 0;
// Remove handle damage override
_unit removeEventHandler ["HandleDamage",temp_handler];
// _unit removeEventHandler ["HandleDamage",temp_handler];
mydamage_eh1 = _unit addeventhandler ["HandleDamage",{_this call fnc_usec_damageHandler;} ];
mydamage_eh2 = _unit addEventHandler ["Fired", {_this call player_fired;}];

View File

@@ -137,7 +137,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version
{
idc = -1;
text = "DayZ Epoch 0.997 (1.7.6.1)";
text = "DayZ Epoch 0.998 (1.7.6.1)";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
};
delete CA_TitleMainMenu;