Decompile fn_21601 (ReceiveShortcutPage)

Batch #5330 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_21601 ReceiveShortcutPage: logic confirmed by peer review

Peer-reviewed-by: alisonrag, sherollyner, tayoba
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-30 10:24:19 +00:00
commit 35bb11a0de
3 changed files with 91 additions and 3 deletions

View file

@ -204,6 +204,12 @@ public:
void ReceivePartyItemPickup(const unsigned char* packet);
void NotifyResult3995(unsigned char result);
void ReceiveActorEffect228(const unsigned char* packet);
void ResendMinimapMarkers();
void ReceiveJobTitle(unsigned char result, int job);
void ReceiveQuestStates(int count, const unsigned char* entries);
void ReceiveMessageBox(const unsigned char* packet);
void NotifyCaptchaRegistered();
void ReceiveItem1784List(const unsigned char* packet);
};
#if defined(_WIN32) && !defined(_WIN64)

View file

@ -17,16 +17,21 @@
#include "Contents/Items/ItemDescription.h"
#include "Contents/Items/ItemInfo.h"
#include "Contents/Items/ItemNaming.h"
#include "Contents/Jobs/JobInheritance.h"
#include "Contents/MessageTable.h"
#include "Contents/Messenger/ClientMessenger.h"
#include "Contents/PlayerNameDictionary.h"
#include "Contents/RenewQuestMgr.h"
#include "Contents/RodexMailStore.h"
#include "Contents/RouletteMgr.h"
#include "Contents/World/World.h"
#include "Render/Renderer.h"
#include "UI/AdventureGuide/UIAdventureGuide.h"
#include "UI/UICaptchaRegisterWnd.h"
#include "UI/UIGradeEnchantWnd.h"
#include "UI/Window/UIWindow.h"
#include "UI/Window/UIWindowMgr.h"
#include "UI/Window/WindowDialogs.h"
#include "Utility/Text/FormatString.h"
#include <cstdint>
@ -788,3 +793,78 @@ void CGameMode::ReceiveGuildUnknown0114List(const unsigned char* packet) {
guildInfo->AddUnknown0114(value);
}
}
#pragma pack(push, 1)
struct ShortcutPagePayload {
/* 0000 */ NormalItemSlot slots[36];
/* 00FC */ NormalItemSlot slot06EB;
/* 0103 */ NormalItemSlot slot06F2;
};
struct QuestStateEntry {
/* 0000 */ unsigned int questId;
/* 0004 */ unsigned char state;
};
struct MessageBoxPacket {
/* 0000 */ std::int16_t id;
/* 0002 */ std::uint16_t captionId;
/* 0004 */ int captionArgument;
/* 0008 */ std::uint16_t textId;
/* 000A */ int textArgument;
};
struct Item1784Entry {
/* 0000 */ int itemId;
/* 0004 */ int quantity;
/* 0008 */ std::uint32_t unknown_0008;
/* 000C */ std::uint32_t unknown_000C;
/* 0010 */ std::uint32_t unknown_0010;
/* 0014 */ std::uint32_t unknown_0014;
};
struct Item1784ListPacket {
/* 0000 */ std::int16_t id;
/* 0002 */ std::int16_t length;
/* 0004 */ std::int16_t flag;
/* 0006 */ Item1784Entry entries[1];
};
#pragma pack(pop)
struct ClientItemLists {
void ClearItems1784(int index);
};
// OFFSET: 0x00D18BD0
// FUNCTION: fn_21601
void ReceiveShortcutPage(int position, const ShortcutPagePayload* payload, std::int16_t bank) {
int base = 0;
if (bank == 0) {
g_session.ClearShortcutSlots();
memcpy_s(g_session.m_shortcutSlots, sizeof(g_session.m_shortcutSlots), payload, sizeof(payload->slots));
g_session.ClearSlots06EB();
g_session.unknown_06EB = payload->slot06EB;
g_session.unknown_06F2 = payload->slot06F2;
base = g_session.unknown_06FC;
} else if (bank == 1) {
g_session.ClearSecondaryShortcutSlots();
memcpy_s(g_session.m_secondaryShortcutSlots, sizeof(g_session.m_secondaryShortcutSlots), payload, sizeof(payload->slots));
base = g_session.unknown_06A8;
}
if (g_windowMgr.window_01E8) {
g_windowMgr.window_01E8->SendMsg(nullptr, 143, position - base + 4, bank, 0, 0);
}
}
// OFFSET: 0x00D18F60
// OFFSET: 0x00D69260
// OFFSET: 0x00D694C0
// OFFSET: 0x00D6E1E0
// OFFSET: 0x00D6E5F0
// OFFSET: 0x00D6ECB0

View file

@ -100,11 +100,12 @@ public:
/* 0420 */ std::uint32_t unknown_0420[36];
/* 04B0 */ NormalItemSlot m_shortcutSlots[36];
/* 05AC */ NormalItemSlot m_secondaryShortcutSlots[36];
/* 06A8 */ unsigned char unknown_06A8[0x04];
/* 06A8 */ int unknown_06A8;
/* 06AC */ NormalItemSlot m_normalItemSlots[9];
/* 06EB */ NormalItemSlot unknown_06EB;
/* 06F2 */ NormalItemSlot unknown_06F2;
/* 06F9 */ unsigned char unknown_06F9[0x07];
/* 06F9 */ unsigned char unknown_06F9[0x03];
/* 06FC */ int unknown_06FC;
/* 0700 */ std::map<int, int> unknown_0700;
/* 0708 */ std::map<int, int> unknown_0708;
/* 0710 */ unsigned char unknown_0710[0x0C];
@ -298,7 +299,8 @@ public:
/* 6150 */ std::int16_t unknown_6150;
/* 6154 */ int unknown_6154;
/* 6158 */ int unknown_6158;
/* 615C */ unsigned char unknown_615C[0x10];
/* 615C */ int unknown_615C;
/* 6160 */ unsigned char unknown_6160[0x0C];
/* 616C */ std::vector<int> unknown_616C;
/* 6178 */ std::vector<SessionRecord6178> unknown_6178;
/* 6184 */ unsigned char unknown_6184[0x04];