diff --git a/src/Components/Modules/Stats.cpp b/src/Components/Modules/Stats.cpp index 8bce7496..c89645f2 100644 --- a/src/Components/Modules/Stats.cpp +++ b/src/Components/Modules/Stats.cpp @@ -2,6 +2,19 @@ namespace Components { + bool Stats::IsMaxLevel() + { + // obtain statsbuffer (offset 4, first 4 bytes is statVersion.) + char* statsBuffer = Utils::Hook::Call(0x4C49F0)(0) + 4; + + // obtain experience from statsbuffer (offset 2056) + std::uint32_t experience = *reinterpret_cast(statsBuffer + 2056); + + // 2516000 should be the max experience. + if (experience >= 2516000) return true; + return false; + } + void Stats::SendStats() { // check if we're connected to a server... diff --git a/src/Components/Modules/Stats.hpp b/src/Components/Modules/Stats.hpp index ba3f133d..e9599729 100644 --- a/src/Components/Modules/Stats.hpp +++ b/src/Components/Modules/Stats.hpp @@ -13,6 +13,7 @@ namespace Components #endif private: + static bool IsMaxLevel(); static void UpdateClasses(UIScript::Token token); static void SendStats();