public static void HandlePetExtraction(GameSession session, PacketReader packet, Item item) { long petUid = long.Parse(packet.ReadUnicodeString()); if (!session.Player.Inventory.Items.ContainsKey(petUid)) { return; } Item pet = session.Player.Inventory.Items[petUid]; Item badge = new Item(70100000) { PetSkinBadgeId = pet.Id, CreationTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds() + Environment.TickCount }; InventoryController.Consume(session, item.Uid, 1); InventoryController.Add(session, badge, true); session.Send(PetSkinPacket.Extract(petUid, badge)); }
private static void HandlePetExtraction(GameSession session, PacketReader packet, Item item) { long petUid = long.Parse(packet.ReadUnicodeString()); if (!session.Player.Inventory.HasItem(petUid)) { return; } Item pet = session.Player.Inventory.GetByUid(petUid); Item badge = new(70100000) { PetSkinBadgeId = pet.Id, CreationTime = TimeInfo.Now() + Environment.TickCount }; session.Player.Inventory.ConsumeItem(session, item.Uid, 1); session.Player.Inventory.AddItem(session, badge, true); session.Send(PetSkinPacket.Extract(petUid, badge)); }