I don't believe the packet structure for the key exchange is on the wiki (although its lurking around the forums).
Use a breakpoint test and figure it out yourself. Make a character from 5165 and implant it in 5290 so you know what values to look for.Quote:
Character Spawning
Packet Layout Offset Type Value
0 ushort 138 + Character_Name
2 ushort 10014
4 uint Character_ModelID
8 uint Character_ID
12 ushort Character_GuildID
14 ushort Character_GuildRank
16 ulong Character_Status
24 uint Character_Helm_ID
28 uint Character_Armour_ID
32 uint Character_Garment_ID
36 uint Character_LeftHand_ID
40 uint Character_RightHand_ID
44 uint Character_Steed_ID
56 ushort Character_HairStyle
58 ushort Character_CordX
60 ushort Character_CordY
62 byte Character_Direction
63 byte Character_Action
68 byte Character_Reborn
69 byte Character_Level
88 byte Character_Nobility
92 ushort Armour_Colour
94 ushort leftHand_Colour
96 ushort HeadGear_Colour
98 uint Character_QuizPoints
102 ushort Linage
108 uint Linage_Points
136 byte String_Count
137 byte Character_Name_Length
138 string Character_Name
i 5290 and 5165 source and different of packet ( Character Spawning 1014/10014)
But I find, please help me
public static byte[] SpawnCharacter(ClientSocket CSocket)
{
PacketBuilder P = new PacketBuilder(10014, 138 + CSocket.Client.Name.Length);
P.Long(CSocket.Client.Model); //Character_ModelID [4]
P.Long(CSocket.Client.ID); //Character_ID [8]
if (CSocket.Client.Guild != null) // [12]
{
P.Short(CSocket.Client.GuildID); //Character_GuildID [12]
P.Int(1); // [14]
P.Byte((byte)CSocket.Client.GuildRank); //Character_GuildRank [15]
}
else // [12]
P.Move(4);
P.ULong(0); //Character_Status [16]
if (!CSocket.Client.Dead && !CSocket.Client.Transformed) // [24]
{
int Garment = 0;
int Head = 0;
int Armor = 0;
int RH = 0;
int LH = 0;
int Steed = 0;
foreach (KeyValuePair<int, Struct.ItemInfo> Item in CSocket.Client.Equipment)
{
if (Item.Value.Position == 1)
Head = Item.Value.ItemID;
else if (Item.Value.Position == 3 && Armor == 0)
Armor = Item.Value.ItemID;
else if (Item.Value.Position == 4)
RH = Item.Value.ItemID;
else if (Item.Value.Position == 5)
LH = Item.Value.ItemID;
else if (Item.Value.Position == 9)
Garment = Item.Value.ItemID;
else if (Item.Value.Position == 12)
Steed = Item.Value.ItemID;
}
P.Long(Head); //Character_Helm_ID [24]
P.Long(Garment); //Character_Armor_ID [28]
P.Long(Armor); //Character_Garment_ID [32]
P.Long(LH); //Character_LeftHand_ID [36]
P.Long(RH); //Character_RightHand_ID [40]
P.Long(Steed); //Character_Steed_ID [44]
}
else
P.Move(24); // [24]
P.Long(12); // [48]
P.Short(0); // [52]
P.Short(0); // [54]
if (!CSocket.Client.Dead)
P.Short(CSocket.Client.Hair); //Character_HairStyle [56]
else
P.Move(2); // [56]
P.Short(CSocket.Client.Loc.X); //Character_CordX [58]
P.Short(CSocket.Client.Loc.Y); //Character_CordY [60]
P.Byte((byte)CSocket.Client.Direction); //Character_Direction [62]
P.Byte((byte)CSocket.Client.Action); //Character_Action [63]
P.Move(4); //[64]
P.Byte((byte)CSocket.Client.Reborn); //Character_Reborn [68]
P.Short(CSocket.Client.Level); //Character_Level [69]
P.Byte(0); // 0 = Screen / 1 = window [71]
P.Move(16); // [72]
P.Long(CSocket.Client.NobleRank); //Character_Nobility [88]
if (CSocket.Client.Equipment.ContainsKey(3))
{
Struct.ItemInfo Item1 = CSocket.Client.Equipment[3];
P.Short(Item1.Color); //Armor_Color [92]
}
else
P.Move(2);
if (CSocket.Client.Equipment.ContainsKey(5))
{
Struct.ItemInfo Item2 = CSocket.Client.Equipment[5];
P.Short(Item2.Color); //leftHand_Color [94]
}
else
P.Move(2);
if (CSocket.Client.Equipment.ContainsKey(1))
{
Struct.ItemInfo Item3 = CSocket.Client.Equipment[1];
P.Short(Item3.Color); //HeadGear_Color [96]
}
else
P.Move(2);
P.Long(CSocket.Client.UPoints); //Character_QuizPoints [98]
if (CSocket.Client.Equipment.ContainsKey(12))
{
Struct.ItemInfo Item4 = CSocket.Client.Equipment[12];
P.Short(Item4.Plus); //Linage [102]
}
else
P.Move(2); // [102]
P.Long(0); // Unknown [104]
if (CSocket.Client.Equipment.ContainsKey(12))
{
Struct.ItemInfo Item5 = CSocket.Client.Equipment[12];
P.Long(Item5.SocketProgress); //Linage_Points [108]
}
else
P.Move(4);
P.Move(24); // [112]
P.Byte(1); //String_Count [136]
P.Byte((byte)CSocket.Client.Name.Length); //Character_Name_Length [137]
P.Text(CSocket.Client.Name); //Character_Name [138]
return P.getFinal(); // <== sends [138 + Char Name]
}