Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions GameServer/packets/Server/PacketLib1125.cs
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,13 @@ public override void SendMerchantWindow(MerchantCatalog catalog, eMerchantWindow
{
foreach (var page in catalog.GetAllPages())
{
if (page.Currency.Equals(Currency.Copper) == false) windowType = ConvertCurrencyToMerchantWindowType(page.Currency);
// Adjust Window Type depending on the currency; this makes multi-currency merchants possible, which don't exist on Live
var actualWindowType = windowType == eMerchantWindowType.Normal ? ConvertCurrencyToMerchantWindowType(page.Currency) : windowType;

using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.MerchantWindow)))
{
pak.WriteByte((byte)page.EntryCount); //Item count on this page
pak.WriteByte((byte)windowType);
pak.WriteByte((byte)actualWindowType);
pak.WriteByte((byte)page.Number); //Page number
//pak.WriteByte(0x00); //Unused // testing

Expand Down
5 changes: 3 additions & 2 deletions GameServer/packets/Server/PacketLib168.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2319,12 +2319,13 @@ public virtual void SendMerchantWindow(MerchantCatalog catalog, eMerchantWindowT
{
foreach (var page in catalog.GetAllPages())
{
if (page.Currency.Equals(Currency.Copper) == false) ConvertCurrencyToMerchantWindowType(page.Currency);
// Adjust Window Type depending on the currency; this makes multi-currency merchants possible, which don't exist on Live
var actualWindowType = windowType == eMerchantWindowType.Normal ? ConvertCurrencyToMerchantWindowType(page.Currency) : windowType;

using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.MerchantWindow)))
{
pak.WriteByte((byte)page.EntryCount); //Item count on this page
pak.WriteByte((byte)windowType);
pak.WriteByte((byte)actualWindowType);
pak.WriteByte((byte)page.Number); //Page number
pak.WriteByte(0x00); //Unused

Expand Down