rodecomp/Source/Contents/BodyResources.cpp
ragnarok-clanker 6069066306 Decompile fn_19753 (EquipmentResourceMgr::GetBodyResourceName)
Batch #1921 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review.

- fn_19753 EquipmentResourceMgr::GetBodyResourceName: logic confirmed by peer review

Peer-reviewed-by: eAthena
Reviewed-by: ragnarok-clanker
2026-10-28 23:53:53 +00:00

62 lines
1.9 KiB
C++

#include "Client/Session.h"
#include "Contents/EquipmentResourceMgr.h"
#include "Contents/Jobs/JobId.h"
#include "Utility/Text/FormatString.h"
#include <string>
// OFFSET: 0x00E3D300
// FUNCTION: fn_24186
bool CSession::IsSecondJob(int job) {
return job >= JT_RUNE_KNIGHT_2ND && job < JT_SECOND_JOB_END;
}
// OFFSET: 0x00E0A3A0
// FUNCTION: fn_23795
std::string CSession::GetBodyJobName(int job) {
return this->m_bodyJobNames[job];
}
// OFFSET: 0x00BAB850
// FUNCTION: fn_19753
std::string EquipmentResourceMgr::GetBodyResourceName(int type, int job, int sex, int costumeJob, int costume) {
std::string result;
std::string sexName;
std::string jobName;
const bool secondJob = g_session.IsSecondJob(costumeJob);
const int spriteJob = g_session.GetSpriteJob(job, costumeJob, true);
sexName = g_session.GetSexName(sex);
jobName = g_session.GetBodyJobName(spriteJob);
if (secondJob == true) {
result = this->GetBodyRacePrefix(spriteJob + 3950) +
FormatOwnedString("\\몸통\\%s\\costume_%d\\%s_%s_%d.%s", sexName.c_str(), 1, jobName.c_str(), sexName.c_str(), 1, g_equipmentResourceExtensions[type]);
} else {
result = this->GetBodyRacePrefix(spriteJob + 3950) +
FormatOwnedString("\\몸통\\%s\\%s_%s.%s", sexName.c_str(), jobName.c_str(), sexName.c_str(), g_equipmentResourceExtensions[type]);
}
if (costume == 2) {
std::size_t found = result.rfind("마도기어_");
if (found != std::string::npos) {
result.replace(found, 9, "마도아머_", 9);
}
found = result.rfind("MEISTER_MADOGEAR1");
if (found != std::string::npos) {
result.replace(found, 17, "MEISTER_MADOGEAR2", 17);
}
}
return result;
}
// OFFSET: 0x00BABEF0
// FUNCTION: fn_19754
std::string EquipmentResourceMgr::GetBodyRacePrefix(int job) {
if (g_session.IsDoramJob(job) == true) {
return "도람족";
}
return "인간족";
}