Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //--
- CPacketCreateCharacter::CPacketCreateCharacter(const string &name, const string &password)
- : CPacket(104)
- {
- //SEX
- uint sex = (uchar)g_CreateCharacterManager.GetFemale();
- uint slot = 0xFFFFFFFF;
- IFOR(i, 0, g_CharacterList.Count)
- {
- if (!g_CharacterList.GetName(i).length())
- {
- slot = (uint)i;
- break;
- }
- }
- //Podle http://uo.torfo.org/packetguide/
- // BYTE cmd
- WriteUInt8(0x00);
- // BYTE[4] pattern1 (0xedededed)
- WriteUInt32BE(0xEDEDEDED);
- // BYTE[4] pattern2 (0xffffffff)
- WriteUInt32BE(0xffffffff);
- // BYTE pattern3 (0x00)
- WriteUInt8(0x00);
- // BYTE[30] char name
- WriteString(name.c_str(), 30, false);
- // BYTE[30] char password
- WriteString(password.c_str(), 30, false);
- // BYTE sex (0=male, 1=female)
- WriteUInt8(sex);
- // BYTE str
- WriteUInt8(0x14);
- // BYTE dex
- WriteUInt8(0x14);
- // BYTE int
- WriteUInt8(0x19);
- // BYTE skill1
- WriteUInt8(0x01);
- // BYTE skill1value
- WriteUInt8(0x21);
- // BYTE skill2
- WriteUInt8(0x02);
- // BYTE skill2value
- WriteUInt8(0x21);
- // BYTE skill3
- WriteUInt8(0x03);
- // BYTE skill3value
- WriteUInt8(0x22);
- // BYTE[2] skinColor
- WriteUInt16BE(g_CreateCharacterManager.SkinTone);
- // BYTE[2] hairStyle
- WriteUInt16BE(g_CreateCharacterManager.GetHair(g_CreateCharacterManager.HairStyle).GraphicID);
- // BYTE[2] hairColor
- WriteUInt16BE(g_CreateCharacterManager.HairColor);
- // BYTE[2] facial hair
- WriteUInt16BE(g_CreateCharacterManager.GetBeard(g_CreateCharacterManager.BeardStyle).GraphicID);
- // BYTE[2] facial hair color
- WriteUInt16BE(g_CreateCharacterManager.BeardColor);
- // BYTE[2] location # from starting list
- WriteUInt16BE(0x01); //koho zajma lokace...
- // BYTE[2] unknown1
- WriteUInt16BE(0x0000);
- // BYTE[2] slot
- WriteUInt16BE(slot);
- // BYTE[4] clientIP
- WriteDataBE(g_ConnectionManager.GetClientIP(), 4);
- // BYTE[2] shirt color
- WriteUInt16BE(g_CreateCharacterManager.ShirtColor);
- // BYTE[2] pants color
- WriteUInt16BE(g_CreateCharacterManager.PantsColor);
- return;
- //Podle http://necrotoolz.sourceforge.net/kairpacketguide/packet00.htm
- // byte 0x00 The packet number.
- WriteUInt8(0x00);
- // uint 0xEDEDEDED Unknown
- WriteUInt32BE(0xEDEDEDED);
- // uint 0xFFFFFFFF Unknown
- WriteUInt32BE(0xffffffff);
- // byte 0x00 Unknown
- WriteUInt8(0x00);
- // char[30] Name The character's name.
- WriteString(name.c_str(), 30, false);
- // char[30] Password The character's password.
- WriteString(password.c_str(), 30, false);
- // byte Gender The character's gender (C#|VB7).
- WriteUInt8(sex);
- // byte Strength The character's strength.
- WriteUInt8(0x14);
- // byte Dexterity The character's dexterity.
- WriteUInt8(0x14);
- // byte Intelligencer The character's intelligence.
- WriteUInt8(0x19);
- // byte Skill1 The character's first skill (See List).
- WriteUInt8(0x01);
- // byte Skill1Amount The character's first skill value.
- WriteUInt8(0x21);
- // byte Skill2 The character's second skill (See List).
- WriteUInt8(0x02);
- // byte Skill2Amount The character's second skill value.
- WriteUInt8(0x21);
- // byte Skill3 The character's third skill (See List).
- WriteUInt8(0x03);
- // byte Skill3Amount The character's third skill value.
- WriteUInt8(0x22);
- // ushort Hue The character's skin color.
- WriteUInt16BE(g_CreateCharacterManager.SkinTone);
- // ushort HairStyle The artwork number for the character's hair.
- WriteUInt16BE(g_CreateCharacterManager.GetHair(g_CreateCharacterManager.HairStyle).GraphicID);
- // ushort HairColor The character's hair color.
- WriteUInt16BE(g_CreateCharacterManager.HairColor);
- // ushort BeardStyle The artwork number for the character's beard.
- WriteUInt16BE(g_CreateCharacterManager.GetBeard(g_CreateCharacterManager.BeardStyle).GraphicID);
- // ushort BeardColor The character's beard color.
- WriteUInt16BE(g_CreateCharacterManager.BeardColor);
- // ushort City The character's starting city (as listed in the character list).
- WriteUInt8(0x01); //koho zajma lokace...
- // ushort 0x0000 Unknown.
- WriteUInt16BE(0x0000);
- // ushort Slot The character slot number.
- WriteUInt8(slot);
- // uint Key The user's gameplay encryption key.
- WriteDataBE(g_ConnectionManager.GetClientIP(), 4);
- // ushort Shirt The color of the character's shirt.
- WriteUInt16BE(g_CreateCharacterManager.ShirtColor);
- // ushort Pants The color of the character's pants.
- WriteUInt16BE(g_CreateCharacterManager.PantsColor);
- return;
- //Podle seznamu na POL serveru.... (nefungovalo)
- // BYTE[1] Command
- WriteUInt8(0x00);
- // BYTE[4] pattern1 (0xedededed) =5
- WriteUInt32BE(0xEDEDEDED);
- // BYTE[4] pattern2 (0xffffffff) =9
- WriteUInt32BE(0xffffffff);
- // BYTE[1] pattern3 (0x00) =10
- WriteUInt8(0x00);
- // BYTE[30] char name = 40
- WriteString(name.c_str(), 30, false);
- // BYTE[2] unknown0=42
- WriteUInt16BE(0x0000);
- // BYTE[4] clientflag (see notes)=46
- WriteUInt32BE(0x20);
- // BYTE[4] unknown1=50
- WriteUInt32BE(0x00000000);
- // BYTE[4] logincount=54
- WriteUInt32BE(0x00000000);
- // BYTE[1] profession=55
- WriteUInt8(0x01); //profession nezajem... dam tam jednucku treba :D:D
- // BYTE[15] unknown2=70
- Move(15);
- // BYTE[1] sex (see notes)=71
- WriteUInt8(sex);
- // BYTE[1] str =72
- WriteUInt8(0x14);
- // BYTE[1] dex =73
- WriteUInt8(0x14);
- // BYTE[1] int
- WriteUInt8(0x19);
- // BYTE[1] skill1
- WriteUInt8(0x01);
- // BYTE[1] skill1value
- WriteUInt8(0x21);
- // BYTE[1] skill2
- WriteUInt8(0x02);
- // BYTE[1] skill2value
- WriteUInt8(0x21);
- // BYTE[1] skill3
- WriteUInt8(0x03);
- // BYTE[1] skill3value =80
- WriteUInt8(0x22);
- // BYTE[2] skinColor =82
- WriteUInt16BE(g_CreateCharacterManager.SkinTone);
- // BYTE[2] hairStyle =84
- WriteUInt16BE(g_CreateCharacterManager.GetHair(g_CreateCharacterManager.HairStyle).GraphicID);
- // BYTE[2] hairColor =86
- WriteUInt16BE(g_CreateCharacterManager.HairColor);
- // BYTE[2] facial hair =88
- WriteUInt16BE(g_CreateCharacterManager.GetBeard(g_CreateCharacterManager.BeardStyle).GraphicID);
- // BYTE[2] facial hair color =90
- WriteUInt16BE(g_CreateCharacterManager.BeardColor);
- // BYTE[2] location # from starting list =92
- WriteUInt8(0x01); //koho zajma lokace...
- // BYTE[2] unknown3 (Usually 0x00 in testing)=94
- WriteUInt8(0x00);
- // BYTE[2] slot=96
- WriteUInt8(slot);
- // BYTE[4] clientIP =100
- WriteDataBE(g_ConnectionManager.GetClientIP(), 4);
- // BYTE[2] shirt color=102
- WriteUInt16BE(g_CreateCharacterManager.ShirtColor);
- // BYTE[2] pants color=104
- WriteUInt16BE(g_CreateCharacterManager.PantsColor);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement