Originally Posted by
dowigr
HAs anybody found the new:
/// <summary>
/// Battleground
/// </summary>
public enum Battleground
{
statPvp = 0xAF7EAC, <-- not this one.. we have that now in this thread.
pvpExitWindow = 0xAF7F88,
selectedBattleGroundID = 0xAF7F34,
}
SelectedBAttlegroundID and pvpexit window are proving to be very hard for me to find in IDA...
I'll take tips on how to find them. Actually I would prefer if someone would point me in the right direction to find them, so I can find them again next patch too.
I'm not skilled at reversing and not really familiar with the offsets your looking for. I'd suggest either listing the relevant WoW API if you know where it comes from or explain what exactly the offset is supposed to retrieve and maybe I can help. I did however look up selectedBattleGroundID and used GetBattlegroundInfo in order to perhaps help since that API returns a battlegroundID based on the index provided. I'll put the Pseudocode with some of my comments I added that might be helpful to you.
Code:
signed int __cdecl Script_GetBattlegroundInfo(int a1)
{
signed int result; // eax@2
int v2; // esi@3
__int64 v3; // qax@3
void *v4; // ebx@3
int v5; // eax@6
int v6; // esi@6
int v7; // esi@16
int v8; // eax@18
int v9; // [sp+10h] [bp-8h]@0
char v10; // [sp+14h] [bp-4h]@7
if ( !lua_isnumber(a1, 1) )
{
luaL_error(a1, "Usage: GetBattlegroundInfo(index)", v9);
return 0;
}
v2 = (signed int)lua_tonumber(a1, 1) - 1;
LODWORD(v3) = ClntObjMgrGetActivePlayer();
v4 = ClntObjMgrObjectPtr(
v3,
TYPEMASK_PLAYER,
"d:\\BuildServer\\WoW\\6\\work\\WoW-code\\branches\\wow-patch-4_3_0-branch\\WoW\\Source\\Object/ObjectClient/Player_C.h",
176);
if ( v4 && v2 >= 0 && v2 < (signed int)dword_B36BC4 && (v5 = sub_53E2B0(v2), (v6 = ClientDB::GetRow(v5)) != 0) )
{
lua_pushstring(a1, *(_DWORD *)(v6 + 44)); // Push Localized battleground name
if ( (unsigned __int8)sub_53F280(*(_DWORD *)(*((_DWORD *)v4 + 62) + 160), v6, &v10) )
lua_pushnumber(a1, 1.0); // Push canEnter Flag
else
lua_pushnil(a1);
if ( GetWorldState(*(_DWORD *)(v6 + 52)) )
lua_pushnumber(a1, 1.0); // push isHoliday Flag
else
lua_pushnil(a1);
if ( *(_DWORD *)v6 == 32 )
lua_pushnumber(a1, 1.0); // push isRandom Flag
else
lua_pushnil(a1);
lua_pushnumber(a1, (double)*(signed int *)v6); // Start BatteGroundID work
v7 = ClientDB::GetRow(*(_DWORD *)(v6 + 4));
if ( !v7 )
return 5;
v8 = CGPlayer_C::GetPVPFactionIndex(v4);
if ( v8 )
{
if ( v8 == 1 )
{
lua_pushstring(a1, *(_DWORD *)(v7 + 36));
return 6;
}
}
else
{
lua_pushstring(a1, *(_DWORD *)(v7 + 32));
}
result = 6;
}
else
{
result = 0;
}
return result;
}