Skip to content

Commit 52d272e

Browse files
committed
Address change in NpcOffer server packet
1 parent 24609b9 commit 52d272e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

TibiaAPI/Network/ServerPackets/NpcOffer.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class NpcOffer : ServerPacket
1010
public List<(ushort Id, byte Data, string Name, uint Weight, uint BuyPrice, uint SellPrice)> Offers { get; } =
1111
new List<(ushort Id, byte Data, string Name, uint Weight, uint BuyPrice, uint SellPrice)>();
1212

13+
public string CurrencyName { get; set; }
1314
public string NpcName { get; set; }
1415

1516
public ushort CurrencyItemId { get; set; }
@@ -27,6 +28,11 @@ public override void ParseFromNetworkMessage(NetworkMessage message)
2728
{
2829
CurrencyItemId = message.ReadUInt16();
2930
}
31+
if (Client.VersionNumber >= 12409997)
32+
{
33+
// If this is set, it will override `CurrencyItemId`.
34+
CurrencyName = message.ReadString();
35+
}
3036
Offers.Capacity = message.ReadUInt16();
3137
for (var i = 0; i < Offers.Capacity; ++i)
3238
{
@@ -48,6 +54,10 @@ public override void AppendToNetworkMessage(NetworkMessage message)
4854
{
4955
message.Write(CurrencyItemId);
5056
}
57+
if (Client.VersionNumber >= 12409997)
58+
{
59+
message.Write(CurrencyName);
60+
}
5161
var count = Math.Min(Offers.Count, ushort.MaxValue);
5262
message.Write((ushort)count);
5363
for (var i = 0; i < count; ++i)

0 commit comments

Comments
 (0)