Цитата:
Сообщение от MaS0n
это не флаг, а все-таки статус
|
FriendStatus это маска из флагов, в т.ч. и RAF
Код:
struct FriendInfo
{
_BYTE Connected;
_BYTE Status;
_BYTE f2[2];
const char *Name;
_BYTE Note[512];
WGUID Guid;
signed int Level;
_DWORD Class;
_DWORD AreaId;
_DWORD dword21C;
};
Код:
signed int __cdecl Lua_GetFriendInfo(int a1)
{
signed int result; // eax@3
FriendInfo *fInfo; // edi@6
int v3; // eax@8
char *v4; // ebx@9
int v5; // eax@10
int v6; // ebx@12
const char *v7; // eax@13
DWORD v8; // ecx@13
WGUID v9; // ST18_8@13
int v10; // eax@13
int v11; // eax@17
int v12; // ecx@19
int v13; // eax@20
int v14; // eax@23
const char *v15; // ecx@26
char status; // al@32
char *v17; // eax@33
char *v18; // eax@35
const char *v19; // [sp+4h] [bp-1Ch]@14
WGUID v20; // [sp+14h] [bp-Ch]@5
char *v21; // [sp+1Ch] [bp-4h]@9
if ( !FrameScript__IsNumber(a1, 1) && !FrameScript__IsString(a1, 1) )
{
FrameScript__DisplayError(a1, "Usage: GetFriendInfo(index or name)");
return 0;
}
if ( FrameScript__IsNumber(a1, 1) )
{
v20 = (WGUID)(signed __int64)FrameScript__ToNumber(a1, 1);
if ( v20.guid_low - 1 <= 100 )
fInfo = (FriendInfo *)((char *)dword_C79F98 + 544 * (v20.guid_low - 1));
else
fInfo = 0;
}
else
{
v3 = FrameScript__ToLString(a1, 1, 0);
fInfo = (FriendInfo *)GetFriendInfoByName(dword_C79F98, v3);
}
v4 = FrameScript__GetText("UNKNOWN", -1, 0);
v21 = v4;
if ( !fInfo )
{
FrameScript__pushnil(a1); // name
FrameScript__PushNumber(a1, 0.0); // level
FrameScript__PushString(a1, v4); // class
FrameScript__PushString(a1, v4); // area
FrameScript__pushnil(a1); // connected
FrameScript__PushString(a1, &byte_9E14FF); // status
FrameScript__pushnil(a1); // note
FrameScript__pushnil(a1); // RAF
return 8;
}
FrameScript__PushString(a1, fInfo->Name); // name
FrameScript__PushNumber(a1, (double)fInfo->Level);// level
v5 = fInfo->Class;
if ( v5 < g_ChrClassesDB.minIndex
|| v5 > g_ChrClassesDB.maxIndex
|| (v6 = g_ChrClassesDB.Rows[v5 - g_ChrClassesDB.minIndex], !v6) )
{
v7 = v21;
goto LABEL_16;
}
v8 = fInfo->Guid.guid_low;
v20.guid_low = 0;
v20.guid_high = 0;
v9.guid_high = fInfo->Guid.guid_high;
v9.guid_low = v8;
v10 = DbNameCache_GetInfoBlockById(&WDB_CACHE_NAME, *(_QWORD *)&v9, (int)&v20, 0, 0, 0);
v7 = (const char *)sub_72AAB0(0, v10);
if ( v7 )
{
LABEL_16:
v19 = v7;
goto LABEL_17;
}
v19 = *(const char **)(v6 + 16);
LABEL_17:
FrameScript__PushString(a1, v19); // class
v11 = fInfo->AreaId;
if ( v11 < g_AreaTableDB.minIndex )
goto LABEL_46;
if ( v11 > g_AreaTableDB.maxIndex )
goto LABEL_46;
v12 = g_AreaTableDB.Rows[v11 - g_AreaTableDB.minIndex];
if ( !v12 )
goto LABEL_46;
v13 = *(_DWORD *)(v12 + 8);
if ( v13 )
{
if ( v13 >= g_AreaTableDB.minIndex )
{
if ( v13 <= g_AreaTableDB.maxIndex )
{
v14 = g_AreaTableDB.Rows[v13 - g_AreaTableDB.minIndex];
if ( v14 )
v12 = v14;
}
}
}
if ( v12 )
v15 = *(const char **)(v12 + 44);
else
LABEL_46:
v15 = v21;
FrameScript__PushString(a1, v15); // area
if ( fInfo->Connected )
FrameScript__PushNumber(a1, 1.0); // connected
else
FrameScript__pushnil(a1); // connected
if ( !fInfo->Connected )
goto LABEL_36;
status = fInfo->Status;
if ( !(status & 4) )
{
if ( status & 2 )
{
v18 = FrameScript__GetText("CHAT_FLAG_AFK", -1, 0);
FrameScript__PushString(a1, v18); // status
goto LABEL_37;
}
LABEL_36:
FrameScript__PushString(a1, &byte_9E14FF); // status
goto LABEL_37;
}
v17 = FrameScript__GetText("CHAT_FLAG_DND", -1, 0);
FrameScript__PushString(a1, v17); // status
LABEL_37:
if ( fInfo->Note[0] )
FrameScript__PushString(a1, fInfo->Note); // note
else
FrameScript__pushnil(a1); // note
if ( fInfo->Status & 8 )
{
FrameScript__PushNumber(a1, 1.0); // RAF
result = 8;
}
else
{
FrameScript__pushnil(a1); // RAF
result = 8;
}
return result;
}