Exemplo n.º 1
0
        public static void ItemUpdate(Client client, MabiCreature creature, MabiItem item)
        {
            var packet = new MabiPacket(Op.ItemUpdate, creature.Id);
            packet.AddItemInfo(item, ItemPacketType.Private);

            client.Send(packet);
        }
Exemplo n.º 2
0
        public static void OpenNPCShop(WorldClient client, MabiShop shop)
        {
            var packet = new MabiPacket(Op.OpenNPCShop, client.Character.Id);
            packet.PutString("shopname");
            packet.PutByte(0);
            packet.PutByte(0);
            packet.PutInt(0);
            packet.PutByte((byte)shop.Tabs.Count);
            for (var i = 0; i < shop.Tabs.Count; ++i)
            {
                packet.PutString("[{0}]{1}", i, shop.Tabs[i].Name);

                // [160200] ?
                {
                    packet.PutByte(0);
                }

                packet.PutShort((ushort)shop.Tabs[i].Items.Count);
                foreach (var item in shop.Tabs[i].Items)
                    packet.AddItemInfo(item, ItemPacketType.Private);
            }
            client.Send(packet);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sends view equipment to client. Response is negative if items is null.
        /// </summary>
        /// <param name="client"></param>
        /// <param name="targetId"></param>
        /// <param name="items"></param>
        public static void ViewEquipmentResponse(WorldClient client, ulong targetId, IEnumerable<MabiItem> items)
        {
            var packet = new MabiPacket(Op.ViewEquipmentR, client.Character.Id);
            if (items != null)
            {
                packet.PutByte(true);
                packet.PutLong(targetId);
                packet.PutInt((ushort)items.Count());
                foreach (var item in items)
                    packet.AddItemInfo(item, ItemPacketType.Private);
            }
            else
            {
                packet.PutByte(false);
            }

            client.Send(packet);
        }