From ef21913c3fcb046b53dab038b7a256995b39e5a0 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 28 Oct 2026 22:51:51 +0000 Subject: [PATCH] Decompile 4 functions in Source/Contents/Jobs/JobInheritance.cpp, Source/Client/Session.h, ... Batch #1842 by ragnarok-clanker: 0 byte-identical, 4 confirmed by peer review. - fn_23837 CSession::GetWeaponActName: logic confirmed by peer review - fn_23838 CSession::GetWeaponEffectActName: logic confirmed by peer review - fn_23839 CSession::GetWeaponEffectSprName: logic confirmed by peer review - fn_23840 CSession::GetWeaponSprName: logic confirmed by peer review Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Session.h | 14 +++- Source/Contents/EquipmentResourceMgr.h | 2 + Source/Contents/Jobs/JobInheritance.cpp | 103 +++++++++++++++++++++++- 3 files changed, 116 insertions(+), 3 deletions(-) diff --git a/Source/Client/Session.h b/Source/Client/Session.h index 1c75307..6a3279d 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -139,7 +139,10 @@ public: /* 5254 */ std::map m_npcLocationRadius; /* 525C */ unsigned char unknown_525C[0x44]; /* 52A0 */ const char* const* m_sexNames; - /* 52A4 */ unsigned char unknown_52A4[0x14]; + /* 52A4 */ unsigned char unknown_52A4[0x08]; + /* 52AC */ const char* const* m_weaponNamesBegin; + /* 52B0 */ const char* const* m_weaponNamesEnd; + /* 52B4 */ unsigned char unknown_52B4[0x04]; /* 52B8 */ std::vector m_accessoryNames; /* 52C4 */ unsigned char unknown_52C4[0x294]; /* 5558 */ int unknown_5558; @@ -184,7 +187,8 @@ public: /* 7FA8 */ CInstantVar m_options; /* 7FB4 */ unsigned char unknown_7FB4[0xC0]; /* 8074 */ int unknown_8074; - /* 8078 */ unsigned char unknown_8078[0x3C]; + /* 8078 */ const char* const* m_jobSpriteNames; + /* 807C */ unsigned char unknown_807C[0x38]; /* 80B4 */ std::map m_nameToId; /* 80BC */ std::map m_shops; /* 80C4 */ unsigned char unknown_80C4[0x58]; @@ -272,6 +276,12 @@ public: int SyncUnknown0E98(); void LoadXmlTables(); std::string GetAccessoryName(int id); + std::string GetWeaponName(int weapon); + const char* GetWeaponClassName(int item); + std::string GetWeaponActName(int job, int sex, int weapon, int weaponItem, int costume); + std::string GetWeaponSprName(int job, int sex, int weapon, int weaponItem, int costume); + std::string GetWeaponEffectActName(int job, int sex, int weapon, int weaponItem, int effect, int costume); + std::string GetWeaponEffectSprName(int job, int sex, int weapon, int weaponItem, int effect, int costume); void CollectCardItems(); void SetHomunculusAutoFeed(bool enabled); void SetPetAutoFeed(bool enabled); diff --git a/Source/Contents/EquipmentResourceMgr.h b/Source/Contents/EquipmentResourceMgr.h index 75dec90..5d54eba 100644 --- a/Source/Contents/EquipmentResourceMgr.h +++ b/Source/Contents/EquipmentResourceMgr.h @@ -9,6 +9,8 @@ public: std::string GetRobeSprName(int robe, int); std::string GetHeadName(int type, int job, int sex, int* head); std::string GetHeadPalName(int head, int job, int sex, int palette); + std::string GetWeaponResourceName(int type, int job, int sex, int weapon, int weaponItem, int costume); + std::string GetWeaponEffectResourceName(int type, int job, int sex, int weapon, int weaponItem, int effect, int costume); }; extern EquipmentResourceMgr* g_equipmentResourceMgr; diff --git a/Source/Contents/Jobs/JobInheritance.cpp b/Source/Contents/Jobs/JobInheritance.cpp index e7a30f8..6028274 100644 --- a/Source/Contents/Jobs/JobInheritance.cpp +++ b/Source/Contents/Jobs/JobInheritance.cpp @@ -3,13 +3,15 @@ #include "Contents/Items/ItemDescription.h" #include "Contents/Skills/SkillInfo.h" #include "Client/Session.h" +#include "Contents/EquipmentResourceMgr.h" #include "Contents/Jobs/JobInheritance.h" #include "Contents/Jobs/JobId.h" #include "Contents/Skills/PlayerSkillBundle.h" #include "Script/LuaScript.h" +#include "Utility/Text/FormatString.h" -#include #include +#include // GLOBAL: gl_24496 int g_screenShakeDuration; @@ -413,6 +415,105 @@ bool __stdcall IsJobWeaponAllowed(int job, int slot, std::int64_t weapon) { } } + +// OFFSET: 0x00E0AB60 +// FUNCTION: fn_23803 +std::string CSession::GetWeaponName(int weapon) { + const unsigned index = GetRealWeaponId(weapon); + if (index < static_cast(this->m_weaponNamesEnd - this->m_weaponNamesBegin)) { + return this->m_weaponNamesBegin[index]; + } + + return this->m_weaponNamesBegin[0]; +} + +// OFFSET: 0x00DE3800 +// FUNCTION: fn_23482 +const char* CSession::GetWeaponClassName(int item) { + const char* name = nullptr; + if (g_session.m_hotkeyScript->Call("ReqWeaponNameByClassNum", "d>s", FindItemDescription(item).unknown_0040, &name)) { + return name; + } + + return ""; +} + +// OFFSET: 0x00BAD420 +// FUNCTION: fn_19759 +std::string EquipmentResourceMgr::GetWeaponResourceName(int type, int job, int sex, int weapon, int weaponItem, int costume) { + std::string result; + std::string jobName; + std::string sexName; + std::string weaponName; + + const int spriteJob = g_session.GetSpriteJob(job <= 31 ? job : job + 3950, costume, true); + jobName = g_session.m_jobSpriteNames[spriteJob]; + sexName = g_session.GetSexName(sex); + + if (weaponItem == -1) { + weaponName = g_session.GetWeaponName(weapon); + result = this->GetBodyRacePrefix(spriteJob) + + FormatOwnedString("\\%s_%s%s.%s", jobName.c_str(), sexName.c_str(), weaponName.c_str(), g_equipmentResourceExtensions[type]); + } else { + result = this->GetBodyRacePrefix(spriteJob + 3950) + + FormatOwnedString("\\%s_%s%s.%s", jobName.c_str(), sexName.c_str(), g_session.GetWeaponClassName(weaponItem), g_equipmentResourceExtensions[type]); + } + + return result; +} + +// OFFSET: 0x00BACEE0 +// FUNCTION: fn_19758 +std::string EquipmentResourceMgr::GetWeaponEffectResourceName(int type, int job, int sex, int weapon, int weaponItem, int effect, int costume) { + std::string result; + std::string jobName; + std::string sexName; + std::string weaponName; + const char* const effects[] = {"_검광", "_발광"}; + + const int spriteJob = g_session.GetSpriteJob(job <= 31 ? job : job + 3950, costume, true); + jobName = g_session.m_jobSpriteNames[spriteJob]; + sexName = g_session.GetSexName(sex); + weaponName = g_session.GetWeaponName(weapon); + + const char* const suffix = effects[effect]; + if (weaponItem == -1) { + result = this->GetBodyRacePrefix(spriteJob) + + FormatOwnedString("\\%s_%s%s%s.%s", jobName.c_str(), sexName.c_str(), weaponName.c_str(), suffix, g_equipmentResourceExtensions[type]); + } else { + result = this->GetBodyRacePrefix(spriteJob) + + FormatOwnedString("\\%s_%s%s%s.%s", jobName.c_str(), sexName.c_str(), g_session.GetWeaponClassName(weaponItem), suffix, g_equipmentResourceExtensions[type]); + } + + return result; +} + +// OFFSET: 0x00E19370 +// FUNCTION: fn_23837 +std::string CSession::GetWeaponActName(int job, int sex, int weapon, int weaponItem, int costume) { + return g_equipmentResourceMgr->GetWeaponResourceName(0, job, sex, weapon, weaponItem, costume); +} + +// OFFSET: 0x00E193E0 +// FUNCTION: fn_23838 +std::string CSession::GetWeaponEffectActName(int job, int sex, int weapon, int weaponItem, int effect, int costume) { + return std::string(g_equipmentResourceMgr->GetWeaponEffectResourceName(0, job, sex, weapon, weaponItem, effect, costume)); +} + +// OFFSET: 0x00E19450 +// FUNCTION: fn_23839 +std::string CSession::GetWeaponEffectSprName(int job, int sex, int weapon, int weaponItem, int effect, int costume) { + std::string name = g_equipmentResourceMgr->GetWeaponEffectResourceName(1, job, sex, weapon, weaponItem, effect, costume); + return name; +} + +// OFFSET: 0x00E194C0 +// FUNCTION: fn_23840 +std::string CSession::GetWeaponSprName(int job, int sex, int weapon, int weaponItem, int costume) { + std::string name = g_equipmentResourceMgr->GetWeaponResourceName(1, job, sex, weapon, weaponItem, costume); + return name; +} + // OFFSET: 0x00DFBE10 // FUNCTION: fn_23590 bool __stdcall IsVisibleJob(int job) {