Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- signed int __cdecl Script_GetBattlefieldStatus(int luaState)
- {
- int v1; // esi@1
- signed int result; // eax@2
- int v3; // ST18_4@2
- int v4; // ecx@3
- int curBG; // ebx@3
- int bgStatus; // edi@16
- int v7; // eax@17
- int v8; // eax@20
- int v9; // eax@27
- double v10; // st7@30
- int v11; // [sp+8h] [bp-18h]@11
- v1 = luaState;
- if ( !lua_isnumber(luaState, 1) )
- {
- luaL_error(luaState, "Usage: GetBattlefieldStatus(id)", v3);
- return 0;
- }
- curBG = dword_ECCAE8;
- v4 = (signed __int64)lua_tonumber(luaState, 1);
- if ( dword_ECCAE8 & 1 || !dword_ECCAE8 )
- curBG = 0;
- while ( 1 )
- {
- if ( curBG & 1 || !curBG )
- {
- lua_pushstring(luaState, "none");
- lua_pushnil(luaState);
- lua_pushnumber(luaState, 0.0);
- lua_pushnil(luaState);
- lua_pushnil(luaState);
- return 5;
- }
- if ( *(_DWORD *)(curBG + 8) == v4 )
- break;
- curBG = *(_DWORD *)(curBG + 4);
- }
- switch ( *(_DWORD *)(curBG + 0x34) )
- {
- case 0:
- v11 = (int)"none";
- break;
- case 1:
- v11 = (int)"queued";
- break;
- case 2:
- v11 = (int)"confirm";
- break;
- case 4:
- v11 = (int)"active";
- break;
- default:
- v11 = (int)"error";
- break;
- }
- lua_pushstring(luaState, v11);
- bgStatus = *(_DWORD *)(curBG + 0x34);
- if ( bgStatus != 2 )
- goto LABEL_22;
- v7 = *(_DWORD *)(curBG + 40);
- if ( v7 & 0x100000 || ((*(_QWORD *)(curBG + 40) >> 16) & 0xF) == 1 )
- {
- v1 = luaState;
- LABEL_22:
- if ( bgStatus != 4 )
- goto LABEL_27;
- v8 = ClientDB_Size_0x4C__GetRow((int)&g_MapDB, dword_1126F1C);
- goto LABEL_24;
- }
- if ( (*(_DWORD *)(curBG + 40) & 0xFFFF) == 32 )
- {
- v1 = luaState;
- LABEL_27:
- v9 = sub_994690(*(_DWORD *)(curBG + 40) & 0xFFFF);
- if ( v9 )
- lua_pushstring(v1, *(_DWORD *)(v9 + 52));
- else
- lua_pushnil(v1);
- goto LABEL_30;
- }
- v8 = ClientDB_Size_0x4C__GetRow((int)&g_MapDB, *(_DWORD *)(curBG + 48));
- v1 = luaState;
- LABEL_24:
- if ( !v8 )
- goto LABEL_27;
- lua_pushstring(v1, *(_DWORD *)(v8 + 20));
- LABEL_30:
- v10 = (double)*(signed int *)(curBG + 80);
- if ( *(_DWORD *)(curBG + 80) < 0 )
- v10 = v10 + unk_D282A8;
- lua_pushnumber(v1, v10);
- if ( *(_DWORD *)(curBG + 84) )
- lua_pushnumber(v1, 1.0);
- else
- lua_pushnil(v1);
- if ( *(_DWORD *)(curBG + 92) )
- {
- lua_pushnumber(v1, 1.0);
- result = 5;
- }
- else
- {
- lua_pushnil(v1);
- result = 5;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement