PDA

Просмотр полной версии : Скрипт кто в пати


TAMBIK
21.07.2009, 14:37
//Знай инфу кто с тобой в пати
// информация приходит в момент вступления в пати
// CP,XP,MP,lvl
//сообщение в чат
// ХБ хроник TAMBIK
var
Name,Message:string;
MaxCP,MaxHP,MaxMP, Level,i:integer;
//===========================================
procedure SendMsg2(msg:string);
begin
buf:=#$4A;
WriteD(0);
WriteD(10);
WriteS('');
WriteS(msg);
SendToClient;
end;
//==========================================

//===========================================
// следим за ЛВЛ
begin
if fromserver and (pck[1]=#$4E) then begin
i:=16;
Name:=ReadS(i);
i:=i+4;
MaxCP:=ReadD(i);
i:=i+4;
MaxHP:=ReadD(i);
i:=i+4;
MaxMP:=ReadD(i);
Level:=ReadD(i);
Message:='CP='+inttostr(MaxCP)+'XP='+inttostr(MaxH P)+'MP='+inttostr(MaxMP)+'lVl='+inttostr(Level);
SendMsg2(Name +':'+ Message);

end;
//===========================================
// следим за ЛВЛ
begin
if fromserver and (pck[1]=#$4F) then begin
i:=12;
Name:=ReadS(i);
i:=i+4;
MaxCP:=ReadD(i);
i:=i+4;
MaxHP:=ReadD(i);
i:=i+4;
MaxMP:=ReadD(i);
Level:=ReadD(i);
Message:='CP='+inttostr(MaxCP)+'XP='+inttostr(MaxH P)+'MP='+inttostr(MaxMP)+'lVl='+inttostr(Level);
SendMsg2(Name +':'+ Message);
end;
end;
end.