Esempio n. 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");
        }
Esempio n. 2
0
        public static void QueryCashItem(PacketReader packet, PacketBuilder builder, ClientHandler client, EventHandler events)
        {
            builder.New(0x1A2);
            {
                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 CashItens = CharacterManagement.GetCashItem(syncServer, server, cid / 8);


                /*
                 * builder += (int)2;          //item qnt
                 *
                 * builder += (int)1;          //item cashid
                 * builder += (int)163865;         //item idx
                 * builder += (byte)0xF4;
                 * builder += (byte)0x00;
                 * builder += (byte)0x00;
                 * builder += (byte)0x00;
                 * //builder += (int)0x000000E4;          //item opt extreme
                 * builder += (int)536871167;  //item opt old
                 * builder += (int)0;
                 * builder += (byte)31;         //duration
                 *
                 * builder += (int)2;          //item cashid
                 * builder += (int)24;         //item idx
                 * builder += (int)4;          //item opt extreme
                 * builder += (int)536871167;  //item opt old
                 * builder += (int)0;
                 * builder += (byte)17;        //duration
                 */



                builder += CashItens.Length;

                foreach (var i in CashItens)
                {
                    builder += (int)i.ID;
                    builder += (int)i.itemid;
                    builder += i.itemopt;
                    builder += (int)i.itemopt2;
                    builder += (byte)i.duration;
                }

                /*
                 * builder += (int)2; //item qnt
                 *
                 * builder += (int)1; //item cashid
                 * builder += (int)25; //item idx
                 * builder += (int)536880405; //item opt
                 * builder += (byte)0; //duration
                 *
                 * builder += (int)2; //item cashid
                 * builder += (int)25; //item idx
                 * builder += (int)0; //item opt
                 * builder += (byte)0; //duration*/
            }

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