Advanced trading fixes/modifications (#1698)

* Advanced trading fixes/modifcations

This adds combine currency option to the Advanced trading screen since
@Airwaves man noticed it didn't have a way of doing it.

Updated stringtables with correct "paid" spelling and differing text for
buying/selling.

This also addds proper currency checking/reporting for the log system
that has been introduced, it's untidy but it works, instead of getting
"user bought x for 1000 currency" in a non coins server, it will convert
it to the proper 1 brief 5 10oz gold etc system (uses a new function
z_calcDefaultCurrencyNoImg)

This also adds a check to see if the buy list is empty (as per the
selling list) and returns text to the user informing them.

Re-arranged buy and sell so buy is on top of sell, it's a bit easier to
read then.

* Advanced trading logging change

This was missing from my previous commit, this changes the
server_tradeobject to check if it's being passed a number (single
currency) or text (my logging currency changes)

* Advanced trading rework

Fixes all problems @ebaydayz
This commit is contained in:
oiad
2016-06-22 12:18:41 +12:00
committed by ebaydayz
parent 63d6cfa87b
commit 801145d664
11 changed files with 487 additions and 333 deletions

View File

@@ -8,29 +8,44 @@ _Z_logTrade = {
_buyOrSell = _this select 2;
_price = _this select 3;
_container = switch (Z_SellingFrom) do {
case 0 : {localize "STR_EPOCH_TRADE_BACKPACK"};
case 1 : {localize "STR_EPOCH_TRADE_VEHICLE"};
case 2 : {localize "STR_UI_GEAR"};
case 0 : {localize "STR_EPOCH_TRADE_BACKPACK"};
case 1 : {localize "STR_EPOCH_TRADE_VEHICLE"};
case 2 : {localize "STR_UI_GEAR"};
};
_currency = if (Z_SingleCurrency) then {"Coins"} else {"Currency"};
_tcost = _price call Z_calcDefaultCurrencyNoImg;
_currency = if (Z_SingleCurrency) then {"Coins"} else {""};
if (isNil "inTraderCity") then {inTraderCity = "Unknown Trader City"};
// Log to client RPT
if (_buyOrSell == "buy") then {
diag_log format["%5: Bought %4 x %1 into %7 at %2 for %3x%6",_className,inTraderCity,_price,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
if (Z_SingleCurrency) then {
if (_buyOrSell == "buy") then {
diag_log format["%5: Bought %4 x %1 into %7 at %2 for %3x%6",_className,inTraderCity,_price,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
} else {
diag_log format["%5: Sold %4 x %1 from %7 at %2 for %3x%6",_className,inTraderCity,_price,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
};
} else {
diag_log format["%5: Sold %4 x %1 from %7 at %2 for %3x%6",_className,inTraderCity,_price,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
};
if (_buyOrSell == "buy") then {
diag_log format["%5: Bought %4 x %1 into %7 at %2 for %3",_className,inTraderCity,_tcost,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
} else {
diag_log format["%5: Sold %4 x %1 from %7 at %2 for %3",_className,inTraderCity,_tcost,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
};
};
// Log to server RPT
if (DZE_serverLogTrades) then {
if (_buyOrSell == "buy") then {
PVDZE_obj_Trade = [player,0,0,_className,inTraderCity,_currency,_price,_quantity,_container,false];
if (Z_SingleCurrency) then {
if (_buyOrSell == "buy") then {
PVDZE_obj_Trade = [player,0,0,_className,inTraderCity,_currency,_price,_quantity,_container,false];
} else {
PVDZE_obj_Trade = [player,0,1,_className,inTraderCity,_currency,_price,_quantity,_container,false];
};
} else {
PVDZE_obj_Trade = [player,0,1,_className,inTraderCity,_currency,_price,_quantity,_container,false];
if (_buyOrSell == "buy") then {
PVDZE_obj_Trade = [player,0,0,_className,inTraderCity,_currency,_tcost,_quantity,_container,false];
} else {
PVDZE_obj_Trade = [player,0,1,_className,inTraderCity,_currency,_tcost,_quantity,_container,false];
};
};
publicVariableServer "PVDZE_obj_Trade";
};
};