Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C# by RunUO ( 14 years ago )
public static void CreateCharacter3D(NetState state, PacketReader pvSrc)
        {
            int size = pvSrc.ReadInt16();
            int unk2 = pvSrc.ReadInt32();
            int charSlot = pvSrc.ReadInt32();

            string name = pvSrc.ReadString(30);
            string unk3 = pvSrc.ReadString(30);

            int prof = pvSrc.ReadByte();
            int flags = pvSrc.ReadByte();
            int gender = pvSrc.ReadByte();
            int raceChar = pvSrc.ReadByte();

            int str = pvSrc.ReadByte();
            int dex = pvSrc.ReadByte();
            int intl = pvSrc.ReadByte();
            int hue = pvSrc.ReadUInt16();

            //int unk4 = pvSrc.ReadInt32();
            pvSrc.Seek(4, SeekOrigin.Current);
            //int unk5 = pvSrc.ReadInt32();
            pvSrc.Seek(4, SeekOrigin.Current);

            int is1 = pvSrc.ReadByte();
            int vs1 = pvSrc.ReadByte();
            int is2 = pvSrc.ReadByte();
            int vs2 = pvSrc.ReadByte();
            int is3 = pvSrc.ReadByte();
            int vs3 = pvSrc.ReadByte();
            int is4 = pvSrc.ReadByte();
            int vs4 = pvSrc.ReadByte();

            pvSrc.Seek(25, SeekOrigin.Current );
            //int unk7 = pvSrc.ReadByte();
            pvSrc.Seek(1, SeekOrigin.Current);

            int hairHue = pvSrc.ReadInt16();
            int hairVal = pvSrc.ReadInt16();

            //int unk8 = pvSrc.ReadByte();
            pvSrc.Seek(1, SeekOrigin.Current);
            //int unk9 = pvSrc.ReadInt32();
            pvSrc.Seek(4, SeekOrigin.Current);
            //int unk10 = pvSrc.ReadByte();
            pvSrc.Seek(1, SeekOrigin.Current);

            int shirtHue = pvSrc.ReadInt16();
            int pantsHue = pvSrc.ReadInt16();

            //int unk11 = pvSrc.ReadByte();
            pvSrc.Seek(1, SeekOrigin.Current);

            int faceHue = pvSrc.ReadInt16();
            int faceID = pvSrc.ReadInt16();

            //int unk12 = pvSrc.ReadByte();
            pvSrc.Seek(1, SeekOrigin.Current);

            int hairHuef = pvSrc.ReadInt16();
            int hairValf = pvSrc.ReadInt16();

            /*
            0x00, 0x01
            0x02, 0x03 -> Human Male, Human Female
            0x04, 0x05 -> Elf Male, Elf Female
            0x05, 0x06 -> Gargoyle Male, Gargoyle Female
            */

            bool female = ((gender % 2) != 0);
            Console.WriteLine(female);
            Race race = null;

            byte raceID = (byte)(raceChar < 4 ? 0 : ((raceChar / 2) - 1));
            race = Race.Races[raceID];

            if (race == null)
                race = Race.DefaultRace;

            CityInfo[] info = state.CityInfo;
            IAccount a = state.Account;

            if (info == null || a == null /*|| cityIndex < 0 || cityIndex >= info.Length*/)
            {
                state.Dispose();
            }
            else
            {
                // Check if anyone is using this account
                for (int i = 0; i < a.Length; ++i)
                {
                    Mobile check = a[i];

                    if (check != null && check.Map != Map.Internal)
                    {
                        Console.WriteLine("Login: {0}: Account in use", state);
                        state.Send(new PopupMessage(PMMessage.CharInWorld));
                        return;
                    }
                }

                state.Flags = (ClientFlags)flags;

                CharacterCreatedEventArgs3D args = new CharacterCreatedEventArgs3D(
                    state, a,
                    name, female, hue,
                    str, dex, intl, info[1], gender, raceChar,
                    new SkillNameValue[4]
     {
      new SkillNameValue( (SkillName)is1, vs1 ),
      new SkillNameValue( (SkillName)is2, vs2 ),
      new SkillNameValue( (SkillName)is3, vs3 ),
      new SkillNameValue( (SkillName)is4, vs4 ),
     },
                    shirtHue, pantsHue,
                    hairVal, hairHue,
                    hairValf, hairHuef,
                    faceHue, faceID,
                    prof, race
                    );

                state.Send(new ClientVersionReq());

                state.BlockAllPackets = true;

                EventSink.InvokeCharacterCreated3D(args);

                Mobile m = args.Mobile;

                if (m != null)
                {
                    state.Mobile = m;
                    m.NetState = state;
                    new LoginTimer(state, m).Start();
                }
                else
                {
                    state.BlockAllPackets = false;
                    state.Dispose();
                }
            }
        }

 

Revise this Paste

Your Name: Code Language: