mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-10 10:12:54 +03:00
Swap bloodbags in traders and loot for classic system
This commit is contained in:
@@ -198,7 +198,7 @@ if (isPlayer cursorTarget) then {
|
||||
};
|
||||
//Allow player to transfuse blood
|
||||
if(_lowBlood && _hasBloodBag) then {
|
||||
_transfuse = if (DZE_UseBloodTypes) then {"\z\addons\dayz_code\medical\transfusion.sqf"} else {"\z\addons\dayz_code\medical\transfusion_NoBloodTypes.sqf"};
|
||||
_transfuse = if (dayz_classicBloodBagSystem) then {"\z\addons\dayz_code\medical\transfusion_NoBloodTypes.sqf"} else {"\z\addons\dayz_code\medical\transfusion.sqf"};
|
||||
r_action = true;
|
||||
_action = _unit addAction [localize "str_actions_medical_08",_transfuse,[_unit], 0, true, true];
|
||||
r_player_actions set [count r_player_actions,_action];
|
||||
|
||||
@@ -20,10 +20,10 @@ if (count _inventory > 0) then {
|
||||
};
|
||||
|
||||
if (_item == "BoltSteel") then { _item = "WoodenArrow" }; // Convert BoltSteel to WoodenArrow
|
||||
if (DZE_UseBloodTypes) then {
|
||||
if (_item == "ItemBloodbag") then { _item = "bloodBagONEG" }; // Convert ItemBloodbag into universal blood type/rh bag
|
||||
} else {
|
||||
if (dayz_classicBloodBagSystem) then {
|
||||
if (_item in dayz_typedBags) then { _item = "ItemBloodbag" };
|
||||
} else {
|
||||
if (_item == "ItemBloodbag") then { _item = "bloodBagONEG" }; // Convert ItemBloodbag into universal blood type/rh bag
|
||||
};
|
||||
|
||||
//Is item legal?
|
||||
|
||||
@@ -12,7 +12,7 @@ TraderCatList = [];
|
||||
TraderItemList = [];
|
||||
|
||||
TraderDialogLoadItemList = {
|
||||
private ["_index","_trader_id","_activatingPlayer","_distance","_objclass","_item_list"];
|
||||
private ["_index","_trader_id","_activatingPlayer","_distance","_objclass","_item_list","_ignore"];
|
||||
TraderItemList = [];
|
||||
_index = _this select 0;
|
||||
|
||||
@@ -51,9 +51,14 @@ TraderDialogLoadItemList = {
|
||||
};
|
||||
};
|
||||
|
||||
_ignore = false;
|
||||
if (dayz_classicBloodBagSystem && _class in dayz_typedBags) then {
|
||||
if (_class == "bloodBagONEG") then {_class = "ItemBloodbag";} else {_ignore = true;};
|
||||
};
|
||||
|
||||
_data = [9999,[_class,_typeNum],99999,_buy,_sell,0,_trader_id,_type];
|
||||
|
||||
PVDZE_plr_TradeMenuResult set [count PVDZE_plr_TradeMenuResult, _data];
|
||||
if (!_ignore) then {PVDZE_plr_TradeMenuResult set [count PVDZE_plr_TradeMenuResult, _data];};
|
||||
};
|
||||
|
||||
lbClear TraderDialogItemList;
|
||||
|
||||
@@ -45,7 +45,7 @@ TraderDialogLoadItemList = {
|
||||
lbClear TraderDialogItemList;
|
||||
_item_list = [];
|
||||
{
|
||||
private ["_header", "_item", "_name", "_type", "_textPart", "_qty", "_buy", "_bqty", "_bname", "_btype", "_btextCurrency", "_sell", "_sqty", "_sname", "_stype", "_stextCurrency", "_order", "_order", "_afile", "_File", "_count", "_bag", "_bagclass", "_index", "_image"];
|
||||
private ["_header", "_item", "_name", "_type", "_textPart", "_qty", "_buy", "_bqty", "_bname", "_btype", "_btextCurrency", "_sell", "_sqty", "_sname", "_stype", "_stextCurrency", "_order", "_order", "_afile", "_File", "_count", "_bag", "_bagclass", "_index", "_image", "_ignore"];
|
||||
_header = _x select 0; // "TRD"
|
||||
_item = _x select 1;
|
||||
_name = _item select 0;
|
||||
@@ -61,6 +61,12 @@ TraderDialogLoadItemList = {
|
||||
_type = "CfgWeapons";
|
||||
};
|
||||
};
|
||||
|
||||
_ignore = false;
|
||||
if (dayz_classicBloodBagSystem && _name in dayz_typedBags) then {
|
||||
if (_name == "bloodBagONEG") then {_name = "ItemBloodbag";} else {_ignore = true;};
|
||||
};
|
||||
|
||||
// Display Name of item
|
||||
_textPart = getText(configFile >> _type >> _name >> "displayName");
|
||||
|
||||
@@ -142,27 +148,29 @@ TraderDialogLoadItemList = {
|
||||
_count = {_x == _name} count weapons player;
|
||||
};
|
||||
|
||||
_index = lbAdd [TraderDialogItemList, format["%1 (%2)", _textPart, _name]];
|
||||
if (!_ignore) then {
|
||||
_index = lbAdd [TraderDialogItemList, format["%1 (%2)", _textPart, _name]];
|
||||
|
||||
if (_count > 0) then {
|
||||
lbSetColor [TraderDialogItemList, _index, [0, 1, 0, 1]];
|
||||
if (_count > 0) then {
|
||||
lbSetColor [TraderDialogItemList, _index, [0, 1, 0, 1]];
|
||||
};
|
||||
|
||||
_image = getText(configFile >> _type >> _name >> "picture");
|
||||
lbSetPicture [TraderDialogItemList, _index, _image];
|
||||
|
||||
_item_list set [count _item_list, [
|
||||
_name,
|
||||
_textPart,
|
||||
_bqty,
|
||||
_bname,
|
||||
_btextCurrency,
|
||||
_sqty,
|
||||
_sname,
|
||||
_stextCurrency,
|
||||
_header,
|
||||
_File
|
||||
]];
|
||||
};
|
||||
|
||||
_image = getText(configFile >> _type >> _name >> "picture");
|
||||
lbSetPicture [TraderDialogItemList, _index, _image];
|
||||
|
||||
_item_list set [count _item_list, [
|
||||
_name,
|
||||
_textPart,
|
||||
_bqty,
|
||||
_bname,
|
||||
_btextCurrency,
|
||||
_sqty,
|
||||
_sname,
|
||||
_stextCurrency,
|
||||
_header,
|
||||
_File
|
||||
]];
|
||||
} forEach PVDZE_plr_TradeMenuResult;
|
||||
TraderItemList = _item_list;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user