VenomRaider Написал:ребят, поделитесь плиз пакетиками новыми типа ExUser ExNpc ExPet итд, просто хочу глянуть что в новых хрониках появилось, а с пакетиками этими у меня туго
[SRC=Pascal]procedure TGameStream.ExUserInfoPacket(Packet: TGamePacket);
var
I: Integer;
Flags: TGamePacketBitFlags;
// ...
function ReadBlockSize(Fixed: Integer = 0): Integer;
begin
Result := Packet.ReadH;
if (Fixed > 0) and (Result <> Fixed) then raise EBadPacket.Create('Invalid block size!');
end;
begin
with Packet do
begin
Player.ObjectId := ReadD;
ReadH; // Size
ReadH;
Flags := ReadBitFlags(23);
if Flags[0] then
begin
ReadD;
end;
if Flags[1] then
begin
ReadBlockSize;
Player.Name := ReadS2;
ReadC;
Player.Race := ReadC;
Player.Sex := ReadC;
Player.BaseClassId := ReadD;
Player.ClassId := ReadD;
Player.Level := ReadC;
end;
if Flags[2] then
begin
ReadBlockSize(14);
Player.Str := ReadH;
Player.Dex := ReadH;
Player.Con := ReadH;
Player.Int := ReadH;
Player.Wit := ReadH;
Player.Men := ReadH;
end;
if Flags[3] then
begin
ReadBlockSize(14);
Player.MaxHP := ReadD;
Player.MaxMP := ReadD;
Player.MaxCP := ReadD;
end;
if Flags[4] then
begin
ReadBlockSize(38);
Player.HP := ReadD;
Player.MP := ReadD;
Player.CP := ReadD;
Player.SP := ReadQ;
Player.Exp := ReadQ;
Player.ExpProgress := ReadF;
end;
if Flags[5] then
begin
ReadBlockSize(3);
ReadC;
end;
if Flags[6] then
begin
ReadBlockSize(15);
Skip(13); // Hair Style, Hair Color, Face
end;
if Flags[7] then
begin
ReadBlockSize(5);
ReadC;
Player.PrivateStoreType := ReadC;
ReadC;
end;
if Flags[8] then
begin
ReadBlockSize(56);
ReadH;
Player.PAtk := ReadD;
Player.PAtkSpd := ReadD;
Player.PDef := ReadD;
Player.EvasionRate := ReadD;
Player.Accuracy := ReadD;
Player.CriticalHit := ReadD;
Player.MAtk := ReadD;
Player.MAtkSpd := ReadD;
Player.PAtkSpd := ReadD;
Player.MAccuracy := ReadD;
Player.MDef := ReadD;
Player.MEvasionRate := ReadD;
Player.MCriticalHit := ReadD;
end;
if Flags[9] then
begin
ReadBlockSize(14);
Player.Elements.Fire := ReadH;
Player.Elements.Water := ReadH;
Player.Elements.Wind := ReadH;
Player.Elements.Earth := ReadH;
Player.Elements.Holy := ReadH;
Player.Elements.Dark := ReadH;
end;
if Flags[10] then
begin
ReadBlockSize(18);
Player.Pos.X := ReadD;
Player.Pos.Y := ReadD;
Player.Pos.Z := ReadD;
ReadD;
end;
if Flags[11] then
begin
ReadBlockSize(18);
for I := 1 to 4 do
begin
ReadH; // Run Speed
ReadH; // Walk Speed
end;
end;
if Flags[12] then
begin
ReadBlockSize(18);
ReadF;
ReadF;
end;
if Flags[13] then
begin
ReadBlockSize(18);
ReadF;
ReadF;
end;
if Flags[14] then
begin
ReadBlockSize(5);
Player.Elements.AttackType := ReadC;
Player.Elements.AttackPower := ReadH;
end;
if Flags[15] then
begin
ReadBlockSize;
Player.Title := ReadS2;
ReadH; // Subdivision
Player.Clan.Id := ReadD;
ReadD;
Player.Clan.CrestId := ReadD;
ReadD;
ReadC;
Player.Clan.AllyId :=ReadD;
Player.Clan.AllyCrestId := ReadD;
ReadC; // PartyRoom
end;
if Flags[16] then
begin
ReadBlockSize(22);
Skip(12); // PvP, Karma, Noble, Hero, Pledge Class, PK
Player.PvP := ReadD;
Player.Recomendations := ReadH;
ReadH; // Recomendations Left
end;
if Flags[17] then
begin
ReadBlockSize(11);
Skip(9);
end;
if Flags[18] then
begin
ReadBlockSize(9);
Skip(7);
end;
if Flags[19] then
begin
ReadBlockSize(4);
ReadC;
Player.IsStanding := ReadBoolC;
end;
if Flags[20] then
begin
ReadBlockSize(10);
Player.NameColor := ReadD;
Player.TitleColor := ReadD;
end;
if Flags[21] then
begin
ReadBlockSize(9);
Skip(7);
end;
if Flags[22] then
begin
ReadBlockSize(13);
Skip(11);
end;
EndOfPacket;
end;
// ...
end;[/SRC]
hLaPEx, Evermore, hAuthD, L2on, ...