rodecomp/Source/Contents/Skills/SkillLevelConfig.cpp
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

41 lines
1.2 KiB
C++

#include "Contents/Skills/SkillLevelConfig.h"
#include <cstdint>
// OFFSET: 0x005E6A10
// FUNCTION: fn_03930
void LoadUseSkillLevels(Json::Value& data, int* levels) {
Json::Value values = data["UseSkillInfo"];
if (!values.isNull()) {
for (auto it = values.begin(); it != values.end(); ++it) {
Json::Value& value = *it;
if (value.isObject()) {
int id = value.get("SKID", 0).asInt();
int level = value.get("SKLv", 0).asInt();
if (static_cast<std::uint32_t>(id) - 1 <= 0x1F3D) {
levels[id] = level;
}
}
}
}
}
// OFFSET: 0x005E63B0
// FUNCTION: fn_03928
void LoadHomunculusSkillLevels(Json::Value& data, int* levels) {
Json::Value values = data["HomunSkillInfo"];
if (!values.isNull()) {
for (auto it = values.begin(); it != values.end(); ++it) {
Json::Value& value = *it;
if (value.isObject()) {
int id = value.get("HomunSKID", 0).asInt();
int level = value.get("HomunSKLv", 0).asInt();
std::uint32_t index = static_cast<std::uint32_t>(id) - 8000;
if (static_cast<std::int32_t>(index) > -1) {
levels[index] = level;
}
}
}
}
}