Decompile 3 functions in Source/Client/Session.cpp, Source/Client/Session.h, ...

Batch #1704 by ragnarok-clanker: 0 byte-identical, 3 confirmed by peer review.

- fn_24179 CSession::IsDoramJob: logic confirmed by peer review
- fn_23770 GetSkillFactor: logic confirmed by peer review
- fn_19754 EquipmentResourceMgr::GetBodyRacePrefix: logic confirmed by peer review

Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-28 20:33:49 +00:00
commit b677bdbc59
5 changed files with 23 additions and 21 deletions

View file

@ -1,4 +1,5 @@
#include "Client/Session.h"
#include "Contents/Jobs/JobId.h"
#include "Network/TextEncoding.h"
#include <cstring>
@ -41,15 +42,15 @@ void CSession::ClearItemSelection() {
// OFFSET: 0x00E3CFF0
// FUNCTION: fn_24179
bool CSession::IsReducedSkill(int skillId) const {
switch (skillId) {
case 4217:
case 4218:
case 4219:
case 4220:
case 4221:
case 4308:
case 4315:
bool CSession::IsDoramJob(int job) const {
switch (job) {
case JT_TRIBE_DORAM:
case JT_DO_SUMMONER:
case JT_DO_CART_SUMMONER:
case JT_DO_SUMMONER_B:
case JT_DO_CART_SUMMONER_B:
case JT_SPIRIT_HANDLER:
case JT_SPIRIT_HANDLER_RIDING:
return true;
default:
return false;

View file

@ -219,7 +219,7 @@ public:
void GetPetHungryStateString(int hunger, char* buffer);
int GetPetEmotionNumber(int job, int action, int hungerLevel);
void ClearItemSelection();
bool IsReducedSkill(int skillId) const;
bool IsDoramJob(int job) const;
char* ConvertTooltipText(const char* source, char* output) const;
int MercSkillLevel(int skillId) const;
int HomunSkillLevel(int skillId) const;

View file

@ -6,7 +6,7 @@
// OFFSET: 0x00BABEF0
// FUNCTION: fn_19754
std::string EquipmentResourceMgr::GetBodyRacePrefix(int job) {
if (g_session.IsReducedSkill(job) == true) {
if (g_session.IsDoramJob(job) == true) {
return "도람족";
}
return "인간족";

View file

@ -1,6 +1,7 @@
#include "Contents/Skills/ClientSkills.h"
#include "Client/Session.h"
#include "Contents/ClientState.h"
#include "Contents/Jobs/JobId.h"
#include "Script/LuaScript.h"
#include "UI/Window/UIWindow.h"
#include "UI/Window/UIWindowMgr.h"
@ -607,19 +608,21 @@ void CSession::ResetItems2B50() {
// OFFSET: 0x00E08B40
// FUNCTION: fn_23770
float GetSkillFactor(int skillId) {
if ((skillId < 4023 || skillId > 4029) && skillId != 4045 && skillId != 4191 && static_cast<unsigned>(skillId - 4030) > 0xE &&
static_cast<unsigned>(skillId - 4096) > 0x10 && static_cast<unsigned>(skillId - 4158) > 0x18 && (skillId < 4194 || skillId > 4196) &&
skillId != 4193 && static_cast<unsigned>(skillId - 4205) > 5 && skillId != 4220 && static_cast<unsigned>(skillId - 4222) > 0x10 &&
skillId != 4241 && skillId != 4242 && skillId != 4244 && skillId != 4247 && skillId != 4248 && skillId != 4352 && skillId != 4354) {
float GetSkillFactor(int job) {
if ((job < JT_NOVICE_B || job > JT_THIEF_B) && job != JT_SUPERNOVICE_B && job != JT_SUPERNOVICE2_B &&
static_cast<unsigned>(job - JT_KNIGHT_B) > JT_CHICKEN2_B - JT_KNIGHT_B && static_cast<unsigned>(job - JT_RUNE_KNIGHT_B) > JT_MADOGEAR_B - JT_RUNE_KNIGHT_B &&
static_cast<unsigned>(job - JT_PORING_NOVICE_B) > JT_DOG_CHASER_B - JT_PORING_NOVICE_B && (job < JT_SHEEP_PRIEST_B || job > JT_PIG_BLACKSMITH_B) &&
job != JT_PORING_SNOVICE2_B && static_cast<unsigned>(job - JT_PIG_MECHANIC_B) > JT_LION_CRUSADER_B - JT_PIG_MECHANIC_B && job != JT_DO_SUMMONER_B &&
static_cast<unsigned>(job - JT_NINJA_B) > JT_STAR2_B - JT_NINJA_B && job != JT_STAR_EMPEROR_B && job != JT_SOUL_REAPER_B && job != JT_STAR2_EMPEROR_B &&
job != JT_HAETAE_STAR_EMPEROR_B && job != JT_HAETAE_SOUL_REAPER_B && job != JT_DRUID_B && job != JT_KARNOS_B) {
return 1.0f;
}
if (g_session.IsReducedSkill(skillId)) {
if (g_session.IsDoramJob(job)) {
return 0.8f;
}
if ((skillId >= 4023 && skillId <= 4029) || skillId == 4045 || skillId == 4191) {
if ((job >= JT_NOVICE_B && job <= JT_THIEF_B) || job == JT_SUPERNOVICE_B || job == JT_SUPERNOVICE2_B) {
return 0.75f;
}

View file

@ -66,10 +66,8 @@ struct ClientSkills {
static_assert(sizeof(ActiveSkillEffect) == 28);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(offsetof(ActiveSkillEffect, unknown_0018) == 0x18);
float GetSkillFactor(int skillId);
#endif
float GetSkillFactor(int skillId);
float GetSkillFactor(int job);
#endif