Decompile fn_21317 (CGameMode::NewActor)
Batch #9414 by secret: 0 byte-identical, 1 confirmed by peer review. - fn_21317 CGameMode::NewActor: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, gordaoprogramas, Montyla Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
5d6dbc1a56
commit
f9faa7318f
4 changed files with 95 additions and 57 deletions
|
|
@ -355,6 +355,7 @@ public:
|
|||
std::uint32_t ActorNameColor(int job, std::uint32_t aid);
|
||||
const CActorNameCard& LookupNameCard(std::uint32_t id);
|
||||
std::vector<char> BuildActorEntryPacket(CGameActor* actor, std::uint16_t packetType);
|
||||
CGameActor* NewActor(int job);
|
||||
const char* DragItemName();
|
||||
void PushUnknown01A4(int value);
|
||||
bool IsOverWeight(bool notify);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include "Client/Replay.h"
|
||||
#include "Client/ReplayPacketRecorder.h"
|
||||
#include "Client/Session.h"
|
||||
#include "Contents/Actors/GameActor.h"
|
||||
#include "Contents/Actors/Npc.h"
|
||||
#include "Contents/Actors/Pc.h"
|
||||
#include "Contents/Camera/Camera.h"
|
||||
#include "Contents/Configuration/ServiceConfiguration.h"
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#include "UI/Window/UIWindow.h"
|
||||
#include "UI/Window/UIWindowMgr.h"
|
||||
#include "UI/Window/WindowDialogs.h"
|
||||
#include "Utility/Math/Vector3d.h"
|
||||
#include "Contents/Actors/GrannyGameActor.h"
|
||||
#include "Utility/Text/FormatString.h"
|
||||
#include "Client/Application/Launcher.h"
|
||||
#include "UI/Text/NavigationLink.h"
|
||||
|
|
@ -3906,3 +3906,20 @@ void CGameMode::ReceiveSkillList(int packetType, const std::vector<SkillListEntr
|
|||
}
|
||||
|
||||
// OFFSET: 0x00CE2880
|
||||
|
||||
// OFFSET: 0x00CDD6B0
|
||||
// FUNCTION: fn_21317
|
||||
CGameActor* CGameMode::NewActor(int job) {
|
||||
CGameActor* actor;
|
||||
if (IsPlayerJob(job)) {
|
||||
actor = new CCharacterNpc;
|
||||
} else {
|
||||
const char* jobName = g_session.GetJobName(job, -1);
|
||||
if (std::strstr(jobName, ".gr2") != nullptr) {
|
||||
actor = new C3dGrannyGameActor(jobName);
|
||||
} else {
|
||||
actor = new CNpc;
|
||||
}
|
||||
}
|
||||
return actor;
|
||||
}
|
||||
|
|
|
|||
74
Source/Contents/Actors/GrannyGameActor.h
Normal file
74
Source/Contents/Actors/GrannyGameActor.h
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
#ifndef RAGNAROK_SOURCE_CONTENTS_ACTORS_GRANNYGAMEACTOR_H
|
||||
#define RAGNAROK_SOURCE_CONTENTS_ACTORS_GRANNYGAMEACTOR_H
|
||||
|
||||
#include "Contents/Actors/GameActor.h"
|
||||
#include "Resource/Models/GrannyModelResource.h"
|
||||
#include "Utility/Math/AffineMatrix.h"
|
||||
#include "Utility/Math/Vector3d.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
class CTexture;
|
||||
struct RenderCommand;
|
||||
struct RenderVertex;
|
||||
|
||||
struct GrannyActorLight {
|
||||
/* 0000 */ vector3d direction;
|
||||
/* 000C */ int intensity;
|
||||
/* 0010 */ int red;
|
||||
/* 0014 */ int green;
|
||||
/* 0018 */ int blue;
|
||||
};
|
||||
|
||||
class C3dGrannyGameActor : public CGameActor {
|
||||
public:
|
||||
explicit C3dGrannyGameActor(const char* name);
|
||||
void SetAction(unsigned animation, int motion, int repeat) override;
|
||||
void Slot08() override;
|
||||
void Slot36() override;
|
||||
int Slot37() override;
|
||||
void Unused6860(int value);
|
||||
void Unused7950(int value);
|
||||
void SetModel(int job, int value, int unused);
|
||||
void Render(int argument) override;
|
||||
void RenderLit(int argument, const GrannyActorLight& light);
|
||||
void RenderShadowed(int argument);
|
||||
void SpawnCorpseActor();
|
||||
bool OnProcess() override;
|
||||
|
||||
/* 0410 */ CTexture* emblemTexture;
|
||||
/* 0414 */ C3dGrannyModelRes* model;
|
||||
/* 0418 */ granny_model_instance* instance;
|
||||
/* 041C */ RenderCommand* commands[30];
|
||||
/* 0494 */ RenderVertex* vertices[30];
|
||||
/* 050C */ granny_system_clock clock;
|
||||
/* 051C */ granny_system_clock lastClock;
|
||||
/* 052C */ float unknown_052C;
|
||||
/* 0530 */ unsigned char unknown_0530[0x08];
|
||||
/* 0538 */ float angle;
|
||||
/* 053C */ unsigned char alpha;
|
||||
/* 053D */ unsigned char unknown_053D[0x03];
|
||||
/* 0540 */ unsigned brightness;
|
||||
/* 0544 */ int motion;
|
||||
/* 0548 */ unsigned char unknown_0548[0x04];
|
||||
/* 054C */ char name[0x104];
|
||||
/* 0650 */ int unknown_0650;
|
||||
/* 0654 */ int unknown_0654;
|
||||
/* 0658 */ granny_control* controls[20];
|
||||
/* 06A8 */ unsigned char unknown_06A8;
|
||||
/* 06A9 */ unsigned char unknown_06A9[0x03];
|
||||
/* 06AC */ CTexture* meshTextures[30];
|
||||
/* 0724 */ std::uint16_t* meshIndices[30];
|
||||
/* 079C */ int meshTriangleCounts[30];
|
||||
/* 0814 */ matrix meshTransforms[30];
|
||||
/* 0DB4 */ unsigned char unknown_0DB4[0x04];
|
||||
/* 0DB8 */ CTexture* texture;
|
||||
/* 0DBC */ std::vector<vector3d> unknown_0DBC;
|
||||
};
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(C3dGrannyGameActor) == 0xDC8);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
#include "Contents/Actors/Npc.h"
|
||||
#include "Contents/Actors/GrannyGameActor.h"
|
||||
#include "Contents/Actors/RenderObject.h"
|
||||
#include "ActorPickNode.h"
|
||||
#include "Contents/Effects/MsgEffect.h"
|
||||
|
|
@ -127,61 +128,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
struct GrannyActorLight {
|
||||
/* 0000 */ vector3d direction;
|
||||
/* 000C */ int intensity;
|
||||
/* 0010 */ int red;
|
||||
/* 0014 */ int green;
|
||||
/* 0018 */ int blue;
|
||||
};
|
||||
|
||||
class C3dGrannyGameActor : public CGameActor {
|
||||
public:
|
||||
explicit C3dGrannyGameActor(const char* name);
|
||||
void SetAction(unsigned animation, int motion, int repeat) override;
|
||||
void Slot08() override;
|
||||
void Slot36() override;
|
||||
int Slot37() override;
|
||||
void Unused6860(int value);
|
||||
void Unused7950(int value);
|
||||
void SetModel(int job, int value, int unused);
|
||||
void Render(int argument) override;
|
||||
void RenderLit(int argument, const GrannyActorLight& light);
|
||||
void RenderShadowed(int argument);
|
||||
void SpawnCorpseActor();
|
||||
bool OnProcess() override;
|
||||
|
||||
|
||||
/* 0410 */ CTexture* emblemTexture;
|
||||
/* 0414 */ C3dGrannyModelRes* model;
|
||||
/* 0418 */ granny_model_instance* instance;
|
||||
/* 041C */ RenderCommand* commands[30];
|
||||
/* 0494 */ RenderVertex* vertices[30];
|
||||
/* 050C */ granny_system_clock clock;
|
||||
/* 051C */ granny_system_clock lastClock;
|
||||
/* 052C */ float unknown_052C;
|
||||
/* 0530 */ unsigned char unknown_0530[0x08];
|
||||
/* 0538 */ float angle;
|
||||
/* 053C */ unsigned char alpha;
|
||||
/* 053D */ unsigned char unknown_053D[0x03];
|
||||
/* 0540 */ unsigned brightness;
|
||||
/* 0544 */ int motion;
|
||||
/* 0548 */ unsigned char unknown_0548[0x04];
|
||||
/* 054C */ char name[0x104];
|
||||
/* 0650 */ int unknown_0650;
|
||||
/* 0654 */ int unknown_0654;
|
||||
/* 0658 */ granny_control* controls[20];
|
||||
/* 06A8 */ unsigned char unknown_06A8;
|
||||
/* 06A9 */ unsigned char unknown_06A9[0x03];
|
||||
/* 06AC */ CTexture* meshTextures[30];
|
||||
/* 0724 */ std::uint16_t* meshIndices[30];
|
||||
/* 079C */ int meshTriangleCounts[30];
|
||||
/* 0814 */ matrix meshTransforms[30];
|
||||
/* 0DB4 */ unsigned char unknown_0DB4[0x04];
|
||||
/* 0DB8 */ CTexture* texture;
|
||||
/* 0DBC */ std::vector<vector3d> unknown_0DBC;
|
||||
};
|
||||
|
||||
class CGrannyCorpse3d : public CGameObject {
|
||||
public:
|
||||
explicit CGrannyCorpse3d(const char* name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue