From 885b472340c2ac8355ce235351f2717390553def Mon Sep 17 00:00:00 2001 From: Mitch Freeman <65987027+neckkola@users.noreply.github.com> Date: Sun, 13 Apr 2025 16:05:59 -0300 Subject: [PATCH] WIP --- zone/trading.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/zone/trading.cpp b/zone/trading.cpp index c78cca0fb..ae69c52fa 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -1423,6 +1423,10 @@ void Client::BuyTraderItem(const EQApplicationPacket *app) auto quantity = in->quantity; inst_copy->SetCharges(quantity); + if (buy_inst->GetItem()->MaxCharges > 0) { + inst_copy->SetCharges(buy_inst->GetCharges()); + } + if (inst_copy->IsStackable() && quantity != buy_inst->GetCharges()) { inst_copy->CreateUniqueID(); } @@ -1509,9 +1513,19 @@ void Client::BuyTraderItem(const EQApplicationPacket *app) QueuePacket(app); LogTrading("Customer Paid: [{}] to {}", DetermineMoneyString(total_cost), trader->GetCleanName()); - LogTrading("Customer Received: [{}] {} with unique_id of {}", quantity, in->item_name, inst_copy->GetUniqueID()); + LogTrading("Customer Received: [{}] {} {} with unique_id of {}", + quantity, + in->item_name, + inst_copy->GetItem()->MaxCharges > 0 ? fmt::format("with {} charges ", inst_copy->GetCharges()).c_str() : std::string(""), + inst_copy->GetUniqueID() + ); LogTrading("Trader Received: [{}] from {}", DetermineMoneyString(total_cost), GetCleanName()); - LogTrading("Trader Sent: [{}] {} with unique_id of {}", quantity, in->item_name, buy_inst->GetUniqueID()); + LogTrading("Trader Sent: [{}] {} {} with unique_id of {}", + quantity, + in->item_name, + buy_inst->GetItem()->MaxCharges > 0 ? fmt::format("with {} charges ", buy_inst->GetCharges()).c_str() : std::string(""), + buy_inst->GetUniqueID() + ); if (merchant_quantity > quantity) { std::unique_ptr vendor_inst(buy_inst ? buy_inst->Clone() : nullptr);