diff --git a/Source/Client/Mode/CGameMode.h b/Source/Client/Mode/CGameMode.h index 834807cb..56fd01ba 100644 --- a/Source/Client/Mode/CGameMode.h +++ b/Source/Client/Mode/CGameMode.h @@ -115,7 +115,8 @@ public: /* 00FC */ int unknown_00FC; /* 0100 */ unsigned char unknown_0100[0x18]; /* 0118 */ std::string unknown_0118; - /* 0130 */ unsigned char unknown_0130[0x30]; + /* 0130 */ std::string unknown_0130; + /* 0148 */ std::string exchangeName; /* 0160 */ CActorNameCardHolder nameCard; /* 0194 */ std::map unknown_0194; /* 019C */ std::map> unknown_019C; @@ -129,7 +130,12 @@ public: /* 01E0 */ unsigned char unknown_01E0[4]; /* 01E4 */ std::vector loopSounds; /* 01F0 */ std::map minimapMarkers; - /* 01F8 */ unsigned char unknown_01F8[0x54]; + /* 01F8 */ int unknown_01F8; + /* 01FC */ std::string unknown_01FC; + /* 0214 */ std::string unknown_0214; + /* 022C */ std::string unknown_022C; + /* 0244 */ int unknown_0244; + /* 0248 */ std::uint32_t unknown_0248; /* 024C */ int unknown_024C; /* 0250 */ int unknown_0250; /* 0254 */ int unknown_0254; @@ -163,13 +169,21 @@ public: /* 040C */ int unknown_040C; /* 0410 */ unsigned char unknown_0410[0x04]; /* 0414 */ int unknown_0414; - /* 0418 */ unsigned char unknown_0418[0x40]; + /* 0418 */ unsigned char unknown_0418; + /* 041C */ int miniMapTooltipId; + /* 0420 */ std::string miniMapTooltipText; + /* 0438 */ std::string unknown_0438; + /* 0450 */ int unknown_0450; + /* 0454 */ int unknown_0454; /* 0458 */ int unknown_0458; /* 045C */ unsigned char unknown_045C[0x08]; /* 0464 */ int unknown_0464; - /* 0468 */ unsigned char unknown_0468[0x74]; - /* 04DC */ std::string unknown_04DC; - /* 04F4 */ unsigned char unknown_04F4[0xC8]; + /* 0468 */ unsigned char unknown_0468[0x04]; + /* 046C */ std::string unknown_046C[11]; + /* 0574 */ unsigned char unknown_0574[0x3C]; + /* 05B0 */ int forcedAttack; + /* 05B4 */ int unknown_05B4; + /* 05B8 */ int unknown_05B8; /* 05BC */ int chatLogLines; /* 05C0 */ unsigned char unknown_05C0[0x04]; /* 05C4 */ int unknown_05C4; @@ -526,7 +540,6 @@ public: void ReceiveEquipListPart(unsigned char listType, int count, const unsigned char* data); void ClearItemLists(const unsigned char* packet); void RefreshItemListWindow(unsigned char listType, bool partial); - void ClearUnknown04DC(); void SetFollowTicks(int updateTick, int lostTick); bool IsMenuWindowOpen() const; bool ShowRestrictedNotice(int grade); diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index 84fd97ce..4a3e0a08 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -485,7 +485,7 @@ unsigned CGameMode::sub_CEC6A0(const std::vector& data) { // OFFSET: 0x00CEFE50 // FUNCTION: fn_21407 -void CGameMode::ClearUnknown04DC() { +void UIWindowMgr::ClearUnknown04DC() { this->unknown_04DC.assign("", 0); } @@ -1652,11 +1652,11 @@ void CGameMode::TargetActorByAid(int aid) { *reinterpret_cast(&this->unknown_00D8[0x20]) = 0; if (g_session.GetSceneUnknown004C() == 0 && (HIBYTE(GetAsyncKeyState(VK_CONTROL)) || forceOption != 0)) { this->RequestPlayerAction(aid, 0); - *reinterpret_cast(&this->unknown_04F4[0xBC]) = 1; + this->forcedAttack = 1; return; } this->RequestPlayerAction(aid, 1); - *reinterpret_cast(&this->unknown_04F4[0xBC]) = 0; + this->forcedAttack = 0; } } @@ -2253,8 +2253,8 @@ void CGameMode::ProcessUiMessage(unsigned char* message) { break; case 906: { const GameModeUiWhisperMessage* whisper = reinterpret_cast(message); - *reinterpret_cast(this->unknown_01F8 + 0x34) = whisper->target; - *reinterpret_cast(this->unknown_01F8 + 0x1C) = whisper->text; + this->unknown_022C = whisper->target; + this->unknown_0214 = whisper->text; break; } case 907: { @@ -2562,8 +2562,8 @@ void CGameMode::ChangeZoneServer(std::string mapName, int x, int y, int ip, int GetRagConnection().Close(); g_activeSkillEffects.clear(); - *reinterpret_cast(this->unknown_01F8 + 0x4C) = 1; - *reinterpret_cast(this->unknown_01F8 + 0x50) = timeGetTime(); + this->unknown_0244 = 1; + this->unknown_0248 = timeGetTime(); this->scene->player->SendMsg(nullptr, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (g_screenShakeDuration > 0) { g_screenShakeDuration = g_screenShakeMode == 2 ? 10001 : g_screenShakeDuration; @@ -3360,7 +3360,7 @@ void CGameMode::InitializeState() { *reinterpret_cast(&this->unknown_00D8[8]) = g_screenHeight; this->unknown_00E4 = g_screenWidth; this->unknown_00E8 = g_screenHeight; - *reinterpret_cast(&this->unknown_01F8[0x4C]) = 0; + this->unknown_0244 = 0; this->unknown_024C = 0; this->unknown_0250 = 0; *reinterpret_cast(&this->unknown_0294[0x18]) = 0; @@ -3370,7 +3370,7 @@ void CGameMode::InitializeState() { *reinterpret_cast(&this->unknown_02B8[8]) = 0; this->itemWindow = nullptr; this->unknown_05D0 = nullptr; - *reinterpret_cast(this->unknown_01F8) = -1; + this->unknown_01F8 = -1; this->balloonActorId = 0; *reinterpret_cast(this->unknown_02E4) = 0; *reinterpret_cast(&this->unknown_02E4[4]) = 0; @@ -3393,14 +3393,14 @@ void CGameMode::InitializeState() { *reinterpret_cast(&this->unknown_0100[0x0C]) = 0; *reinterpret_cast(&this->unknown_0100[0x10]) = 0; *reinterpret_cast(&this->unknown_0100[0x14]) = 0; - *reinterpret_cast(&this->unknown_0418[0x38]) = 0; - *reinterpret_cast(&this->unknown_0418[0x3C]) = 0; - *reinterpret_cast(&this->unknown_0418[0x20]) = ""; + this->unknown_0450 = 0; + this->unknown_0454 = 0; + this->unknown_0438 = ""; this->unknown_0408 = nullptr; this->unknown_040C = 0; g_pickInvert = 0; *reinterpret_cast(this->unknown_045C) = 0; - *reinterpret_cast(&this->unknown_0418[4]) = -1; + this->miniMapTooltipId = -1; *reinterpret_cast(&this->unknown_045C[4]) = -1; char subKey[512]; @@ -3427,7 +3427,7 @@ void CGameMode::InitializeState() { this->unknown_026E[0x16] = 0; *reinterpret_cast(&this->unknown_026E[0x06]) = timeGetTime(); *reinterpret_cast(&this->unknown_026E[0x0A]) = timeGetTime(); - *reinterpret_cast(&this->unknown_01F8[0x50]) = timeGetTime(); + this->unknown_0248 = timeGetTime(); *reinterpret_cast(this->unknown_01E0) = timeGetTime(); this->broadcastBalloon = nullptr; *reinterpret_cast(&this->unknown_026E[0x0E]) = timeGetTime(); @@ -4055,7 +4055,7 @@ void CGameMode::ProcessActorClick(int& handled, ActorPickInfo* pick, CGameActor* } int& targetAid = *reinterpret_cast(&this->unknown_00EC[0x04]); - int& forced = *reinterpret_cast(&this->unknown_04F4[0xBC]); + int& forced = this->forcedAttack; if (attack != 0 && g_groundMarkAltEnabled != 0 && g_mouse.buttons[0] == 1 && g_session.IsMercenarySkill(this->unknown_040C)) { CGameActor* mercenary = static_cast(this->scene->GetGameActorByAID(mercenaryAid)); if (mercenary && mercenary->HasUnknown0310Entry()) { @@ -4181,7 +4181,7 @@ int CGameMode::ProcessMousePick(int result, ActorPickInfo* pick) { } ModeCursor& cursor = *reinterpret_cast(&this->cursorAction); - int& lockedPick = *reinterpret_cast(&this->unknown_04F4[0xBC]); + int& lockedPick = this->forcedAttack; int& pickTarget = *reinterpret_cast(&this->unknown_00EC[0x00]); int& clickTarget = *reinterpret_cast(&this->unknown_00EC[0x04]); @@ -4323,7 +4323,7 @@ void CGameMode::ProcessStatusIconTooltip(int x, int y) { return; } - int& hoveredId = *reinterpret_cast(this->unknown_01F8); + int& hoveredId = this->unknown_01F8; const int count = static_cast(g_activeSkillEffects.end() - g_activeSkillEffects.begin()); const int rows = (g_renderer->viewport.height - 169) / 35; const int right = g_renderer->viewport.width - 18; diff --git a/Source/Client/Mode/GameModeMiniMap.cpp b/Source/Client/Mode/GameModeMiniMap.cpp index 60b45301..e42eb7a0 100644 --- a/Source/Client/Mode/GameModeMiniMap.cpp +++ b/Source/Client/Mode/GameModeMiniMap.cpp @@ -807,8 +807,8 @@ char g_miniMapTooltipText[256]; // OFFSET: 0x00CD1690 // FUNCTION: fn_21257 void CGameMode::RefreshMiniMapTooltips() { - int& tooltipId = *reinterpret_cast(&this->unknown_0418[0x04]); - std::string& tooltipText = *reinterpret_cast(&this->unknown_0418[0x08]); + int& tooltipId = this->miniMapTooltipId; + std::string& tooltipText = this->miniMapTooltipText; std::map& tooltipWindows = *reinterpret_cast*>(&this->unknown_05D4[0x08]); if (tooltipId == -1) { @@ -893,8 +893,8 @@ void CGameMode::RefreshMiniMapTooltips() { // OFFSET: 0x00CD0B30 // FUNCTION: fn_21254 int CGameMode::UpdateMiniMapTooltip() { - int& tooltipId = *reinterpret_cast(&this->unknown_0418[0x04]); - std::string& tooltipText = *reinterpret_cast(&this->unknown_0418[0x08]); + int& tooltipId = this->miniMapTooltipId; + std::string& tooltipText = this->miniMapTooltipText; int id = tooltipId; if (id > 9 || id == -1) { this->RefreshMiniMapTooltips(); diff --git a/Source/Client/Mode/GameModeNotices.cpp b/Source/Client/Mode/GameModeNotices.cpp index 577962bc..557eaf2a 100644 --- a/Source/Client/Mode/GameModeNotices.cpp +++ b/Source/Client/Mode/GameModeNotices.cpp @@ -3038,7 +3038,7 @@ void CGameMode::ReceiveExchangeItemAddAck(const unsigned char* data) { // FUNCTION: fn_21625 void CGameMode::ReceiveExchangeRequestAck2(const unsigned char* data) { const auto* packet = reinterpret_cast(data); - const std::string& exchangeName = *reinterpret_cast(&this->unknown_0130[0x18]); + const std::string& exchangeName = this->exchangeName; switch (packet->result) { case 3: { this->SendMsg(40, 0, 0, 0, 0); @@ -3090,7 +3090,7 @@ void CGameMode::ReceiveExchangeRequestAck(const unsigned char* data) { g_windowMgr.CloseWindow(10011); UIWindow* window = g_windowMgr.EnsureWindow(10011); if (window) { - const std::string& exchangeName = *reinterpret_cast(&this->unknown_0130[0x18]); + const std::string& exchangeName = this->exchangeName; window->SendMsg(nullptr, 50, reinterpret_cast(exchangeName.c_str()), 0, 0, 0); } break; diff --git a/Source/Client/Mode/GameModePackets.cpp b/Source/Client/Mode/GameModePackets.cpp index 079e59de..b73ee047 100644 --- a/Source/Client/Mode/GameModePackets.cpp +++ b/Source/Client/Mode/GameModePackets.cpp @@ -1555,7 +1555,7 @@ void CGameMode::IgnorePacket478(const unsigned char*) { // OFFSET: 0x00D3A1D0 // FUNCTION: fn_21775 void CGameMode::ClearUnknown0244(const unsigned char*) { - *reinterpret_cast(this->unknown_01F8 + 0x4C) = 0; + this->unknown_0244 = 0; } #pragma pack(push, 1) @@ -1831,8 +1831,8 @@ void CGameMode::ReceiveDynamicNpcNotice(const unsigned char* packet) { // OFFSET: 0x00D079A0 // FUNCTION: fn_21584 void CGameMode::sub_D079A0(unsigned char kind, int argument) { - std::string& speaker = *reinterpret_cast(this->unknown_01F8 + 0x1C); - std::string& target = *reinterpret_cast(this->unknown_01F8 + 0x34); + std::string& speaker = this->unknown_0214; + std::string& target = this->unknown_022C; switch (kind) { case 0: { @@ -8286,7 +8286,7 @@ void CGameMode::ReceiveItemPickupAck2(const unsigned char* data) { item.unknown_0060 = packet->refine; item.unknown_0068 = packet->expireTime; if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&this->unknown_04F4[0xC4]) = 0; + this->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -8315,7 +8315,7 @@ void CGameMode::ReceiveItemPickupAck2(const unsigned char* data) { item.unknown_0060 = packet->refine; item.unknown_0068 = packet->expireTime; if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&this->unknown_04F4[0xC4]) = 0; + this->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -8379,7 +8379,7 @@ void CGameMode::ReceiveItemPickupAck3(const unsigned char* data) { item.unknown_0064 = packet->bindOnEquip; item.unknown_0074[1] = 1; if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&this->unknown_04F4[0xC4]) = 0; + this->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -8412,7 +8412,7 @@ void CGameMode::ReceiveItemPickupAck3(const unsigned char* data) { item.unknown_0068 = packet->expireTime; item.unknown_0064 = packet->bindOnEquip; if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&this->unknown_04F4[0xC4]) = 0; + this->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -8476,7 +8476,7 @@ void CGameMode::ReceiveItemPickupAck(const unsigned char* data) { item.unknown_005D = packet->damaged; item.unknown_0060 = packet->refine; if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&this->unknown_04F4[0xC4]) = 0; + this->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -8504,7 +8504,7 @@ void CGameMode::ReceiveItemPickupAck(const unsigned char* data) { item.unknown_005D = packet->damaged; item.unknown_0060 = packet->refine; if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&this->unknown_04F4[0xC4]) = 0; + this->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -8581,7 +8581,7 @@ void CGameMode::ReceiveItemPickupAck5( reinterpret_cast(item.unknown_009C)[option] = options[option]; } if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_04F4[0xC4]) = 0; + static_cast(g_modeMgr.GetGameMode())->unknown_05B8 = 0; } if (type == 10 || type == 16 || type == 17 || type == 19) { item.unknown_0000[3] = 0x8000; @@ -8622,7 +8622,7 @@ void CGameMode::ReceiveItemPickupAck5( reinterpret_cast(item.unknown_009C)[option] = options[option]; } if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_04F4[0xC4]) = 0; + static_cast(g_modeMgr.GetGameMode())->unknown_05B8 = 0; } if (type == 10 || type == 16 || type == 17 || type == 19) { item.unknown_0000[3] = 0x8000; @@ -8695,7 +8695,7 @@ void CGameMode::ReceiveItemPickupAck7(const unsigned char* data) { reinterpret_cast(item.unknown_009C)[option] = options[option]; } if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_04F4[0xC4]) = 0; + static_cast(g_modeMgr.GetGameMode())->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -8735,7 +8735,7 @@ void CGameMode::ReceiveItemPickupAck7(const unsigned char* data) { reinterpret_cast(item.unknown_009C)[option] = options[option]; } if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_04F4[0xC4]) = 0; + static_cast(g_modeMgr.GetGameMode())->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -9771,7 +9771,7 @@ void CGameMode::ReceiveItemPickupAck8(const unsigned char* data) { reinterpret_cast(item.unknown_009C)[option] = options[option]; } if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_04F4[0xC4]) = 0; + static_cast(g_modeMgr.GetGameMode())->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -9814,7 +9814,7 @@ void CGameMode::ReceiveItemPickupAck8(const unsigned char* data) { reinterpret_cast(item.unknown_009C)[option] = options[option]; } if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_04F4[0xC4]) = 0; + static_cast(g_modeMgr.GetGameMode())->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -9891,7 +9891,7 @@ void CGameMode::ReceiveItemPickupAck9(const unsigned char* data) { } item.unknown_0074[0] = packet->favorite; if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_04F4[0xC4]) = 0; + static_cast(g_modeMgr.GetGameMode())->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; @@ -9944,7 +9944,7 @@ void CGameMode::ReceiveItemPickupAck9(const unsigned char* data) { } item.unknown_0074[0] = packet->favorite; if (std::atoi(item.itemId.c_str()) == 607) { - *reinterpret_cast(&static_cast(g_modeMgr.GetGameMode())->unknown_04F4[0xC4]) = 0; + static_cast(g_modeMgr.GetGameMode())->unknown_05B8 = 0; } if (packet->type == 10 || packet->type == 16 || packet->type == 17 || packet->type == 19) { item.unknown_0000[3] = 0x8000; diff --git a/Source/UI/Window/UIWindowMgr.h b/Source/UI/Window/UIWindowMgr.h index 97aad0a9..31b80432 100644 --- a/Source/UI/Window/UIWindowMgr.h +++ b/Source/UI/Window/UIWindowMgr.h @@ -476,6 +476,7 @@ public: void MoveTransient(int x, int y); void RetireTransientWindow(); void ClearWindow01B8(); + void ClearUnknown04DC(); int ProcessMouse(); bool CloseWindow(int id); void CloseWindowExcept251(int id);