From a3943882bb27220e53e26f87ea8860ff5ce91018 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 21:49:33 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/Actors/Player.cpp, Source/Contents/Actors/Pc.h Batch #3409 by youko: 2 byte-identical, 0 confirmed by peer review. - fn_22574 CPc::Slot55: byte-identical - fn_22582 CPc::IsCostumeOutfit: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/Contents/Actors/Pc.h | 29 ++++++++++++++++++++++- Source/Contents/Actors/Player.cpp | 38 +++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/Source/Contents/Actors/Pc.h b/Source/Contents/Actors/Pc.h index d96499a2..1b9bf88f 100644 --- a/Source/Contents/Actors/Pc.h +++ b/Source/Contents/Actors/Pc.h @@ -10,9 +10,14 @@ class C3dGrannyModelRes; class CRes; +struct RenderCommand; +struct RenderVertex; struct granny_control; struct granny_model_instance; +int GetSlotLayer(int slot); +bool IsReadyOrAttackAction(int action); + class CPc : public CGameActor { public: ~CPc() override; @@ -33,6 +38,7 @@ public: void Slot44(int first, int second) override; int Slot46() override; void Slot47(unsigned char value) override; + int Slot55() override; int Slot56() override; void Slot57(int value) override; bool Slot58() override; @@ -44,6 +50,13 @@ public: void LoadEquipActions(const std::vector& names); void LoadEquipSprites(const std::vector& names); int MapMotion(int motion); + std::vector GetEquipActionNames() const; + std::vector GetEquipSpriteNames() const; + CRes* GetEquipAction(unsigned slot) const; + CRes* GetEquipSprite(int slot) const; + int JobActionBase(int state); + bool IsCostumeOutfit() const; + int GetDualWieldWeaponType(int first, int second); float* GetExtent(float* extent) const override; @@ -135,6 +148,7 @@ public: class CGrannyPc : public CGameActor { public: void SetAction(unsigned animation, int motion, int repeat) override; + void Slot08() override; void Slot20(int first, int second, int third, int fourth, int fifth, int sixth, int seventh, int eighth, int ninth, int tenth, int eleventh) override; void Slot21(int value) override; void Slot22(int value) override; @@ -146,11 +160,13 @@ public: void Slot28(int value) override; void Slot30() override; void Slot31() override; + std::int64_t Slot35() override; void Slot39(int value) override; void Slot40(int value) override; void Slot41(int first, int second) override; void PlayMotion(int repeat); + void ReleaseMeshes(); /* 0410 */ std::string unknown_0410; /* 0428 */ int unknown_0428; @@ -171,12 +187,18 @@ public: /* 0484 */ C3dGrannyModelRes* model; /* 0488 */ unsigned char unknown_0488[0x28]; /* 04B0 */ granny_model_instance* instance; - /* 04B4 */ unsigned char unknown_04B4[0xA70]; + /* 04B4 */ RenderCommand* commands[30]; + /* 052C */ RenderCommand* layerCommands[10][30]; + /* 09DC */ RenderVertex* vertices[30]; + /* 0A54 */ RenderVertex* layerVertices[10][30]; + /* 0F04 */ unsigned char unknown_0F04[0x20]; /* 0F24 */ int unknown_0F24; /* 0F28 */ unsigned char unknown_0F28[0x14]; /* 0F3C */ int motion; /* 0F40 */ unsigned char unknown_0F40[0x110]; /* 1050 */ granny_control* controls[20]; + /* 10A0 */ unsigned char unknown_10A0[0x14B0]; + /* 2550 */ int unknown_2550; }; #if defined(_WIN32) && !defined(_WIN64) @@ -191,6 +213,11 @@ static_assert(offsetof(CGrannyPc, instance) == 0x4B0); static_assert(offsetof(CGrannyPc, unknown_0F24) == 0xF24); static_assert(offsetof(CGrannyPc, motion) == 0xF3C); static_assert(offsetof(CGrannyPc, controls) == 0x1050); +static_assert(offsetof(CGrannyPc, commands) == 0x4B4); +static_assert(offsetof(CGrannyPc, layerCommands) == 0x52C); +static_assert(offsetof(CGrannyPc, vertices) == 0x9DC); +static_assert(offsetof(CGrannyPc, layerVertices) == 0xA54); +static_assert(offsetof(CGrannyPc, unknown_2550) == 0x2550); static_assert(sizeof(CBlurPC) == 0x510); static_assert(sizeof(CHalluPC) == 0x518); static_assert(sizeof(CHalluPC2) == 0x518); diff --git a/Source/Contents/Actors/Player.cpp b/Source/Contents/Actors/Player.cpp index 25c82837..70bb962e 100644 --- a/Source/Contents/Actors/Player.cpp +++ b/Source/Contents/Actors/Player.cpp @@ -1,12 +1,15 @@ #include "Contents/Actors/Pc.h" #include "Client/Session.h" +#include "Contents/Actors/ActorStateFlags.h" #include "Contents/CashEmotionMgr.h" #include "Contents/EquipmentResourceMgr.h" +#include "Contents/Items/WeaponType.h" #include "Contents/Jobs/JobId.h" #include "Contents/Jobs/JobInheritance.h" #include "Contents/Jobs/JobNames.h" #include "Contents/MessageTable.h" +#include "Render/Primitives/RenderPrimitive.h" #include "Resource/Models/GrannyModelResource.h" #include "Resource/ResourceMgr.h" #include "Resource/Sprites/ActionResource.h" @@ -555,3 +558,38 @@ int CPc::MapMotion(int motion) { return motion; } } + +// OFFSET: 0x00DAA2E0 + +// OFFSET: 0x00DAA3F0 + +// OFFSET: 0x00DAA520 + +// OFFSET: 0x00DAA5F0 + +// OFFSET: 0x00DAA610 +// FUNCTION: fn_22574 +int CPc::Slot55() { + return CGameActor::Slot55(); +} + +// OFFSET: 0x00DAAD80 + +// OFFSET: 0x00DAB010 + +// OFFSET: 0x00DAB140 + +// OFFSET: 0x00DAB160 + +// OFFSET: 0x00DAB250 +// FUNCTION: fn_22582 +bool CPc::IsCostumeOutfit() const { + return StateFlag12(this->stateFlags) || StateFlag16(this->stateFlags) || StateFlag18(this->stateFlags) || + StateFlag27(this->stateFlags) || StateFlag28(this->stateFlags) || this->unknown_03DC == 1; +} + +// OFFSET: 0x00DAB460 + +// OFFSET: 0x00DAB6A0 + +// OFFSET: 0x00DAC030