Core/Players: since patch 4.0.3a any Justice Points above the hard cap will now convert to 47 silver and 50 copper per point

This commit is contained in:
Ovahlord
2019-05-06 03:06:33 +02:00
parent 5b93b99f3a
commit 65b326ca08
2 changed files with 12 additions and 0 deletions

View File

@@ -7242,8 +7242,18 @@ void Player::ModifyCurrency(uint32 id, int32 count, bool printLog/* = true*/, bo
// count can't be more then totalCap if used (totalCap > 0)
uint32 totalCap = GetCurrencyTotalCap(currency);
// Patch 4.0.3a - Justice Points over the hard cap of 4000 will be converted to 47 silver and 50 copper per point.
uint32 surplousJusticePoints = 0;
if (totalCap && count > int32(totalCap))
{
if (id = CURRENCY_TYPE_JUSTICE_POINTS)
surplousJusticePoints = (count - totalCap) / precision;
count = totalCap;
}
if (surplousJusticePoints)
ModifyMoney(surplousJusticePoints * JUSTICE_POINTS_CONVERSION_MONEY, false);
int32 newTotalCount = int32(oldTotalCount) + count;
if (newTotalCount < 0)

View File

@@ -653,6 +653,8 @@ struct ItemPosCount
};
typedef std::vector<ItemPosCount> ItemPosCountVec;
#define JUSTICE_POINTS_CONVERSION_MONEY 4750
enum TransferAbortReason
{
TRANSFER_ABORT_NONE = 0x00,