示例#1
0
        public static void SendPrivateShopChatNotificationAboutBuyResponse(Asda2PrivateShop shop,
                                                                           List <Asda2ItemTradeRef> itemsBuyed, Character buyer)
        {
            Asda2ItemTradeRef[] asda2ItemTradeRefArray = new Asda2ItemTradeRef[6];
            for (int index = 0; index < itemsBuyed.Count; ++index)
            {
                asda2ItemTradeRefArray[index] = itemsBuyed[index];
            }
            using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.PrivateShopChatNotificationAboutBuy))
            {
                packet.WriteInt32(shop.Owner.AccId);
                packet.WriteInt16(shop.Owner.SessionId);
                packet.WriteByte(
                    ((IEnumerable <Asda2ItemTradeRef>)asda2ItemTradeRefArray).Count <Asda2ItemTradeRef>(
                        (Func <Asda2ItemTradeRef, bool>)(i => i != null)));
                packet.WriteInt32(buyer.AccId);
                for (int index = 0; index < 6; ++index)
                {
                    Asda2Item asda2Item =
                        asda2ItemTradeRefArray[index] == null || asda2ItemTradeRefArray[index].Item == null
                            ? (Asda2Item)null
                            : asda2ItemTradeRefArray[index].Item;
                    packet.WriteInt32(asda2Item == null ? 0 : asda2Item.ItemId);
                    packet.WriteByte(0);
                    packet.WriteInt16(-1);
                    packet.WriteInt32(asda2ItemTradeRefArray[index] == null
                        ? -1
                        : asda2ItemTradeRefArray[index].Amount);
                    packet.WriteInt32(asda2ItemTradeRefArray[index] == null
                        ? -1
                        : (int)asda2ItemTradeRefArray[index].TradeSlot);
                    packet.WriteInt16(0);
                    packet.WriteSkip(Asda2PrivateShopHandler.stub18);
                }

                shop.Send(packet);
            }
        }
示例#2
0
        public static void SendItemBuyedFromPrivateShopToOwnerNotifyResponse(Asda2PrivateShop shop,
                                                                             List <Asda2ItemTradeRef> itemsBuyed, Character buyer)
        {
            Asda2ItemTradeRef[] asda2ItemTradeRefArray = new Asda2ItemTradeRef[6];
            for (int index = 0; index < itemsBuyed.Count; ++index)
            {
                asda2ItemTradeRefArray[index] = itemsBuyed[index];
            }
            using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.ItemBuyedFromPrivateShopToOwnerNotify))
            {
                packet.WriteInt16(shop.Owner.Asda2Inventory.Weight);
                packet.WriteInt32(shop.Owner.Money);
                packet.WriteByte(
                    ((IEnumerable <Asda2ItemTradeRef>)asda2ItemTradeRefArray).Count <Asda2ItemTradeRef>(
                        (Func <Asda2ItemTradeRef, bool>)(i => i != null)));
                packet.WriteInt32(buyer.AccId);
                for (int index = 0; index < 6; ++index)
                {
                    Asda2Item asda2Item =
                        asda2ItemTradeRefArray[index] == null || asda2ItemTradeRefArray[index].Item == null
                            ? (Asda2Item)null
                            : asda2ItemTradeRefArray[index].Item;
                    packet.WriteInt32(asda2Item == null ? 0 : asda2Item.ItemId);
                    packet.WriteByte(asda2Item == null ? (byte)0 : (byte)asda2Item.InventoryType);
                    packet.WriteInt16(asda2Item == null ? 0 : (int)asda2Item.Slot);
                    packet.WriteInt32(asda2ItemTradeRefArray[index] == null
                        ? -1
                        : asda2ItemTradeRefArray[index].Amount);
                    packet.WriteInt32(asda2ItemTradeRefArray[index] == null
                        ? -1
                        : (int)asda2ItemTradeRefArray[index].TradeSlot);
                    packet.WriteInt16(0);
                    packet.WriteSkip(Asda2PrivateShopHandler.stub17);
                }

                shop.Owner.Send(packet, false);
            }
        }
示例#3
0
        public static void SendCharacterPrivateShopInfoResponse(IRealmClient client,
                                                                Asda2ViewTradeShopInfoStatus infoStatus, Asda2PrivateShop shop)
        {
            using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.CharacterPrivateShopInfo))
            {
                packet.WriteByte((byte)infoStatus);
                if (infoStatus == Asda2ViewTradeShopInfoStatus.Ok)
                {
                    packet.WriteInt32(shop.Owner.AccId);
                    packet.WriteInt16(shop.Owner.SessionId);
                    packet.WriteByte(shop.ItemsCount);
                    packet.WriteFixedAsciiString(shop.Owner.Asda2TradeDescription, 50, Locale.Start);
                    packet.WriteFixedAsciiString(shop.Owner.Name, 20, Locale.Start);
                    for (int index = 0; index < 10; ++index)
                    {
                        Asda2Item asda2Item = shop.ItemsOnTrade[index] == null || shop.ItemsOnTrade[index].Item == null
                            ? (Asda2Item)null
                            : shop.ItemsOnTrade[index].Item;
                        packet.WriteInt32(asda2Item == null ? 0 : asda2Item.ItemId);
                        packet.WriteInt32(shop.ItemsOnTrade[index] == null ? -1 : shop.ItemsOnTrade[index].Amount);
                        packet.WriteByte(asda2Item == null ? 0 : (int)asda2Item.Durability);
                        packet.WriteInt16(asda2Item == null ? 0 : (int)asda2Item.Weight);
                        packet.WriteInt16(asda2Item == null ? 0 : asda2Item.Soul1Id);
                        packet.WriteInt16(asda2Item == null ? 0 : asda2Item.Soul2Id);
                        packet.WriteInt16(asda2Item == null ? 0 : asda2Item.Soul3Id);
                        packet.WriteInt16(asda2Item == null ? 0 : asda2Item.Soul4Id);
                        packet.WriteInt16(asda2Item == null ? 0 : (int)asda2Item.Enchant);
                        packet.WriteInt16(0);
                        packet.WriteByte(0);
                        packet.WriteInt16(asda2Item == null ? (short)0 : (short)asda2Item.Parametr1Type);
                        packet.WriteInt16(asda2Item == null ? 0 : (int)asda2Item.Parametr1Value);
                        packet.WriteInt16(asda2Item == null ? (short)0 : (short)asda2Item.Parametr2Type);
                        packet.WriteInt16(asda2Item == null ? 0 : (int)asda2Item.Parametr2Value);
                        packet.WriteInt16(asda2Item == null ? (short)0 : (short)asda2Item.Parametr3Type);
                        packet.WriteInt16(asda2Item == null ? 0 : (int)asda2Item.Parametr3Value);
                        packet.WriteInt16(asda2Item == null ? (short)0 : (short)asda2Item.Parametr4Type);
                        packet.WriteInt16(asda2Item == null ? 0 : (int)asda2Item.Parametr4Value);
                        packet.WriteInt16(asda2Item == null ? (short)0 : (short)asda2Item.Parametr5Type);
                        packet.WriteInt16(asda2Item == null ? 0 : (int)asda2Item.Parametr5Value);
                        packet.WriteByte(0);
                        packet.WriteInt32(shop.ItemsOnTrade[index] == null ? -1 : shop.ItemsOnTrade[index].Price);
                        packet.WriteInt32(asda2Item == null ? 0 : 264156);
                        packet.WriteInt16(asda2Item == null ? 0 : 1);
                    }
                }

                client.Send(packet, false);
            }
        }