rodecomp/Source/Contents/Jobs/JobNameInitialization.cpp
ragnarok-clanker 1122aa7c98 Decompile 7 functions in Source/Contents/Jobs/JobId.h, Source/Contents/Jobs/JobInheritance.cpp, ...
Batch #921 by ragnarok-clanker: 0 byte-identical, 7 confirmed by peer review.

- fn_23461 GetRealWeaponId: logic confirmed by peer review
- fn_23585 ?IsTreeGroupTwo@?A0x66373c89@@YA_NH@Z: logic confirmed by peer review
- fn_23586 ?IsTreeGroupThree@?A0x66373c89@@YA_NH@Z: logic confirmed by peer review
- fn_23587 IsPlayerJob: logic confirmed by peer review
- fn_23907 JobInheritance::InitializeSkillTree: logic confirmed by peer review
- fn_23495 JobNames::Initialize: logic confirmed by peer review
- fn_23444 AttackMotionLength: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
2026-10-26 21:33:33 +00:00

77 lines
2.5 KiB
C++

#include "Contents/Jobs/JobNames.h"
#include "Contents/Jobs/JobId.h"
#include "Script/LuaScript.h"
// OFFSET: 0x00DE67E0
// FUNCTION: fn_23495
void JobNames::Initialize(JobNameInitialization& context) {
this->names.resize(32003, "Poring");
const char* name = nullptr;
const auto player = [&](int first, int end) {
for (int id = first; id < end; ++id) {
if (context.playerScript.Call("ReqPCJobName", "d>s", id, &name) && *name != '\0') {
this->names[id] = name;
}
if (context.playerScript.Call("ReqPCJobNameMan", "d>s", id, &name) && *name != '\0') {
this->male[id] = name;
}
if (context.playerScript.Call("ReqPCJobNameWoman", "d>s", id, &name) && *name != '\0') {
this->female[id] = name;
}
}
};
player(JT_NOVICE, JT_MAX_BASIC);
player(JT_NOVICE_H, JT_UPPER_EXTENDED_JOB2_END);
player(JT_RUNE_KNIGHT_2ND, JT_SECOND_JOB_END);
player(JT_DRUID, JT_2004_JOB_LAST);
const auto other = [&](int first, int end) {
for (int id = first; id < end; ++id) {
context.otherScript.Call("ReqJobName", "d>s", id, &this->names[id]);
}
};
other(JT_WARPNPC, JT_SAFETYWALL);
other(JT_NEW_NPC_START, JT_MON_BEGIN);
other(JT_SCORPION, JT_MONSTER_LAST);
other(JT_NPC_START, JT_NPC_NAME_END);
other(JT_EXTENDED_JOB_NAME_START, JT_EXTENDED_JOB_NAME_END);
const char* const homunculi[] = {"LIF", "AMISTR", "FILIR", "VANILMIRTH", "LIF2", "AMISTR2", "FILIR2", "VANILMIRTH2",
"LIF_H", "AMISTR_H", "FILIR_H", "VANILMIRTH_H", "LIF_H2", "AMISTR_H2", "FILIR_H2", "VANILMIRTH_H2"};
for (unsigned index = 0; index < 16; ++index) {
this->names[JT_MER_LIF + index] = homunculi[index];
}
this->names[JT_MER_EIRA] = "MER_EIRA";
this->names[JT_MER_DIETER] = "MER_DIETER";
this->names[JT_MER_BAYERI] = "MER_BAYERI";
this->names[JT_MER_ELEANOR] = "MER_ELEANOR";
this->names[JT_MER_SERA] = "MER_SERA";
for (unsigned id = JT_MER_ARCHER01; id <= JT_MER_ARCHER10; ++id) {
this->names[id] = "\xBF\xA9\\\xC8\xB0\xBF\xEB\xBA\xB4";
}
for (unsigned id = JT_MER_LANCER01; id <= JT_MER_LANCER10; ++id) {
this->names[id] = "\xB3\xB2\\\xC3\xA2\xBF\xEB\xBA\xB4";
}
for (unsigned id = JT_MER_SWORDMAN01; id <= JT_MER_SWORDMAN10; ++id) {
this->names[id] = "\xB3\xB2\\\xB0\xCB\xBF\xEB\xBA\xB4";
}
context.sexLabels.resize(2, "F");
context.sexLabels[0] = "F";
context.sexLabels[1] = "M";
context.levels20.resize(20, 0);
context.useLevels.resize(7999, 0);
context.otherLevels.resize(258, 0);
context.homunculusLevels.resize(61, 0);
}