Exemple #1
0
        public static void RecvCashItem(PacketReader packet, PacketBuilder builder, ClientHandler client, EventHandler events)
        {
            builder.New(0x1A3);
            {
                var ID       = packet.ReadUShort();
                var unk1     = packet.ReadByte();
                var unk2     = packet.ReadByte();
                var SlotFree = packet.ReadByte();
                var unk4     = packet.ReadByte();



                Character character  = client.Metadata["fullchar"] as Character;
                var       cid        = character.id;
                var       server     = (int)client.Metadata["server"];
                var       syncServer = client.Metadata["syncServer"] as SyncReceiver;
                var       slot       = character.slot;

                var CashItens = CharacterManagement.GetCashItem(syncServer, server, cid / 8);

                for (int i = 0; i < CashItens.Length; i++)
                {
                    if (CashItens[i].ID == ID)
                    {
                        builder += (int)ID;
                        builder += (int)CashItens[i].itemid;
                        builder += CashItens[i].itemopt;
                        builder += (int)CashItens[i].itemopt2;
                        builder += (int)SlotFree;
                        builder += (int)0;
                        builder += (short)0;

                        CharacterManagement.SetCashItem(syncServer, server, CashItens[i].ID);
                    }
                }

                //Log.Message(string.Format("'{0}' '{1}' '{2}' '{3}' '{4}'", ID, unk1, unk2, SlotFree, unk4), ConsoleColor.White, "Recv: ");

                /*
                 * builder += (int)unk0;       //item cashid
                 * builder += (int)163865;         //item idx
                 * builder += (int)244;          //item opt extreme
                 * builder += (int)536871167;  //item opt old
                 * builder += (int)0;          //item opt
                 * builder += (byte)unk3;      //Slot Free
                 * builder += (byte)0;
                 * builder += (byte)0;
                 * builder += (byte)0;
                 *
                 * builder += (int)0;
                 * builder += (short)0;*/
            }

            client.Send(builder, "RecvCashItem");
        }