From 2ba833f291d906cbddfd9fe63b01ecd1b82351a7 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 20:09:59 +0000 Subject: [PATCH] Decompile 2 functions in Source/Client/Session.cpp, Source/Client/Session.h, ... Batch #2985 by eAthena: 2 byte-identical, 0 confirmed by peer review. - fn_24180 CSession::IsEffectRenderEnabled: byte-identical - fn_24194 CSession::ResetUnknownState: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/Client/Session.cpp | 32 ++++++++++++++++++++ Source/Client/Session.h | 39 +++++++++++++++++++++---- Source/Contents/Effects/EffectLists.cpp | 18 ++++++++++++ Source/Contents/Effects/EffectLists.h | 8 +++++ 4 files changed, 91 insertions(+), 6 deletions(-) diff --git a/Source/Client/Session.cpp b/Source/Client/Session.cpp index 70d0f5b4..e032ff86 100644 --- a/Source/Client/Session.cpp +++ b/Source/Client/Session.cpp @@ -9,6 +9,7 @@ #include #include #include +#include // STATIC: 0x01732638 // GLOBAL: gl_24474 @@ -68,6 +69,37 @@ bool CSession::IsDoramJob(int job) const { } } +// OFFSET: 0x00E3D090 +// FUNCTION: fn_24180 +bool CSession::IsEffectRenderEnabled() const { + return true; +} + +// OFFSET: 0x00E3D0A0 + +// OFFSET: 0x00E3D0F0 + +// OFFSET: 0x00E3D240 + +// OFFSET: 0x00E3D320 + +// OFFSET: 0x00E3DB20 +// FUNCTION: fn_24194 +bool CSession::ResetUnknownState() { + this->unknown_59C0 = 1; + this->unknown_59C4 = 1; + this->unknown_59C8 = 1; + this->unknown_59CC = 1; + this->unknown_59D4 = 1; + this->unknown_59BC = 1; + this->unknown_0E94 = 1; + this->unknown_103C = -1; + this->unknown_5450 = 0; + this->m_serverTimeOffset = 0; + this->m_serverTimeAdjustCount = 0; + return true; +} + // OFFSET: 0x00DFF1F0 // FUNCTION: fn_23614 char* CSession::ConvertTooltipText(const char* source, char* output) const { diff --git a/Source/Client/Session.h b/Source/Client/Session.h index 18e05f6c..277e993b 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -93,7 +93,8 @@ public: /* 07A0 */ std::uint32_t m_averagePing; /* 07A4 */ unsigned char unknown_07A4[0x10]; /* 07B4 */ unsigned char m_playerNameKey[0x40]; - /* 07F4 */ unsigned char unknown_07F4[0x6A4]; + /* 07F4 */ unsigned char unknown_07F4[0x6A0]; + /* 0E94 */ int unknown_0E94; /* 0E98 */ int unknown_0E98; /* 0E9C */ unsigned char unknown_0E9C[0x3C]; /* 0ED8 */ int m_head; @@ -122,7 +123,9 @@ public: /* 0FEC */ unsigned char unknown_0FEC[0x24]; /* 1010 */ std::uint32_t unknown_1010; /* 1014 */ unsigned char unknown_1014[4]; - /* 1018 */ char unknown_1018[0x40]; + /* 1018 */ char unknown_1018[0x24]; + /* 103C */ int unknown_103C; + /* 1040 */ unsigned char unknown_1040[0x18]; /* 1058 */ int m_petActionTable[5][5][7]; /* 1314 */ unsigned char unknown_1314[0x258]; /* 156C */ XmlDocument m_petTalkTable; @@ -177,7 +180,9 @@ public: /* 52B8 */ std::vector m_accessoryNames; /* 52C4 */ std::vector m_robeNames; /* 52D0 */ std::vector m_navigationForbiddenMaps; - /* 52DC */ unsigned char unknown_52DC[0x260]; + /* 52DC */ unsigned char unknown_52DC[0x174]; + /* 5450 */ int unknown_5450; + /* 5454 */ unsigned char unknown_5454[0xE8]; /* 553C */ std::string m_serverName; /* 5554 */ unsigned char unknown_5554[4]; /* 5558 */ int unknown_5558; @@ -198,7 +203,14 @@ public: /* 568C */ int m_mercenaryKills; /* 5690 */ unsigned char unknown_5690[4]; /* 5694 */ __time32_t m_mercenaryExpiration; - /* 5698 */ unsigned char unknown_5698[0x340]; + /* 5698 */ unsigned char unknown_5698[0x324]; + /* 59BC */ int unknown_59BC; + /* 59C0 */ int unknown_59C0; + /* 59C4 */ int unknown_59C4; + /* 59C8 */ int unknown_59C8; + /* 59CC */ int unknown_59CC; + /* 59D0 */ int unknown_59D0; + /* 59D4 */ int unknown_59D4; /* 59D8 */ LuaScript* m_hotkeyScript; /* 59DC */ unsigned char unknown_59DC[0x218]; /* 5BF4 */ int m_pairValues[3]; @@ -210,7 +222,8 @@ public: /* 6144 */ std::map unknown_6144; /* 614C */ unsigned char unknown_614C[0x20]; /* 616C */ std::vector unknown_616C; - /* 6178 */ unsigned char unknown_6178[0x14]; + /* 6178 */ unsigned char unknown_6178[0x10]; + /* 6188 */ int m_lastIntervalTime; /* 618C */ const char* const* m_doramMaleHeadNames; /* 6190 */ unsigned char unknown_6190[0x08]; /* 6198 */ const char* const* m_doramFemaleHeadNames; @@ -232,7 +245,8 @@ public: /* 80EC */ std::string unknown_80EC; /* 8104 */ std::string unknown_8104; /* 811C */ std::vector m_cardItems; - /* 8128 */ unsigned char unknown_8128[0x0C]; + /* 8128 */ unsigned char unknown_8128[0x08]; + /* 8130 */ int unknown_8130; /* 8134 */ int unknown_8134; /* 8138 */ std::int64_t m_startTimeTicks; /* 8140 */ std::int64_t m_loginTimeTicks; @@ -374,6 +388,12 @@ public: int GetPetEmotionNumber(int job, int action, int hungerLevel); void ClearItemSelection(); bool IsDoramJob(int job) const; + bool IsEffectRenderEnabled() const; + bool CheckInterval(long long interval); + bool IsPlayerPerformerJob(int job) const; + bool IsSpecialMonsterJob(int job) const; + bool IsWithinUnknown59C0(int value) const; + bool ResetUnknownState(); bool IsSecondJob(int job); void UpdateBodyStyle(int job, int style, int renderJob); std::string GetBodyJobName(int job); @@ -481,6 +501,13 @@ static_assert(offsetof(CSession, unknown_1770) == 0x1770); static_assert(offsetof(CSession, m_itemSlots) == 0x4860); static_assert(offsetof(CSession, m_shops) == 0x80BC); static_assert(offsetof(CSession, unknown_8134) == 0x8134); +static_assert(offsetof(CSession, unknown_0E94) == 0xE94); +static_assert(offsetof(CSession, unknown_103C) == 0x103C); +static_assert(offsetof(CSession, unknown_5450) == 0x5450); +static_assert(offsetof(CSession, unknown_59BC) == 0x59BC); +static_assert(offsetof(CSession, m_hotkeyScript) == 0x59D8); +static_assert(offsetof(CSession, m_lastIntervalTime) == 0x6188); +static_assert(offsetof(CSession, unknown_8130) == 0x8130); static_assert(offsetof(CSession, m_skillBundle) == 0xC); static_assert(offsetof(CSession, m_homunSkills) == 0x84); static_assert(offsetof(CSession, m_mercSkills) == 0x8C); diff --git a/Source/Contents/Effects/EffectLists.cpp b/Source/Contents/Effects/EffectLists.cpp index 9d1a1e1b..2b4edad0 100644 --- a/Source/Contents/Effects/EffectLists.cpp +++ b/Source/Contents/Effects/EffectLists.cpp @@ -4,6 +4,14 @@ #include "Contents/Effects/GravityControlEffect.h" #include "Contents/Effects/SkillEffects.h" +#include "Client/Mode/CGameMode.h" +#include "Client/Session.h" +#include "Client/Mode/ModeMgr.h" +#include "Contents/Camera/Camera.h" +#include "Render/Renderer.h" +#include "Utility/Math/AffineMatrix.h" + +#include #include // OFFSET: 0x00B25750 @@ -22,6 +30,16 @@ CEffect* EffectLists::Find(int actor, int id) const { return nullptr; } +// OFFSET: 0x00B3B040 + +// OFFSET: 0x00B3BE50 + +// OFFSET: 0x00B3BED0 + +// OFFSET: 0x00B3BFD0 + +// OFFSET: 0x00B3C1C0 + // OFFSET: 0x00B257C0 // FUNCTION: fn_18784 CEffect* EffectLists::Find(int actor, int instance, int id) const { diff --git a/Source/Contents/Effects/EffectLists.h b/Source/Contents/Effects/EffectLists.h index 8f171295..db817685 100644 --- a/Source/Contents/Effects/EffectLists.h +++ b/Source/Contents/Effects/EffectLists.h @@ -7,8 +7,11 @@ #include #include #include +#include #include +#include "Utility/Math/Vector3d.h" + struct CAllocator { virtual ~CAllocator() = default; virtual CEffect* Create() = 0; @@ -33,6 +36,7 @@ public: void Retire(int actor, int id); void Retire(int actor, int instance, int id); void RetireActor(int actor); + void Render(); void Clear(); void Release(); }; @@ -46,6 +50,10 @@ static_assert(offsetof(EffectLists, indexed) == 0x20); #endif void DestroyEffectMgr(); +float DirectionAngle(float x, float z); +double ScreenAngle(vector3d from, vector3d to); +std::string CurrentMapScriptName(); +std::string EffectFunctionName(std::string name); extern EffectLists* g_effectMgr;