From de11c7ae80a8c4f2bf06db8d8cc97e02ddfe5260 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 19:44:04 +0000 Subject: [PATCH] Decompile fn_24172 (BuildSkillInfoListPacket) Batch #6087 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_24172 BuildSkillInfoListPacket: logic confirmed by peer review Peer-reviewed-by: alisonrag, Lumen, Snow Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Replay.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Source/Client/Replay.cpp b/Source/Client/Replay.cpp index 195efcef..7866de87 100644 --- a/Source/Client/Replay.cpp +++ b/Source/Client/Replay.cpp @@ -1,9 +1,10 @@ #include "Client/Replay.h" #include "Contents/Configuration/ServiceConfiguration.h" - +#include "Contents/Skills/SkillInfo.h" #include #include #include +#include #include #include #include @@ -893,3 +894,27 @@ void Replay::RestartClock() { this->started = this->previousTick = timeGetTime(); } } + +// OFFSET: 0x00E31240 +// FUNCTION: fn_24172 +std::vector BuildSkillInfoListPacket(std::uint16_t id, const std::list& skills) { + const int bytes = static_cast(skills.size()) * 37 + 4; + std::vector packet(bytes, 0); + unsigned char* data = packet.data(); + *reinterpret_cast(data) = id; + *reinterpret_cast(data + 2) = static_cast(bytes); + unsigned char* record = data + 4; + for (const CSkillInfo& skill : skills) { + *reinterpret_cast(record) = static_cast(skill.id); + *reinterpret_cast(record + 2) = skill.unknown_000C; + *reinterpret_cast(record + 6) = static_cast(skill.level); + *reinterpret_cast(record + 8) = static_cast(skill.unknown_0014); + record[36] = skill.unknown_0018 != 0; + *reinterpret_cast(record + 10) = static_cast(skill.unknown_001C); + const char* name = skill.name; + std::memcpy(record + 12, name, (std::min)(std::strlen(name), std::size_t{24})); + record[35] = 0; + record += 37; + } + return packet; +}