diff --git a/Source/Client/Session.cpp b/Source/Client/Session.cpp index b2549b3..cace029 100644 --- a/Source/Client/Session.cpp +++ b/Source/Client/Session.cpp @@ -1,4 +1,8 @@ #include "Client/Session.h" +#include "Network/TextEncoding.h" + +#include +#include // STATIC: 0x01732638 // GLOBAL: gl_24474 @@ -25,3 +29,36 @@ void CSession::ClearItemSelection() { } } } + +// OFFSET: 0x00E3CFF0 +// FUNCTION: fn_24179 +bool CSession::IsReducedSkill(int skillId) const { + switch (skillId) { + case 4217: + case 4218: + case 4219: + case 4220: + case 4221: + case 4308: + case 4315: + return true; + default: + return false; + } +} + +// OFFSET: 0x00DFF1F0 +// FUNCTION: fn_23614 +char* CSession::ConvertTooltipText(const char* source, char* output) const { + if (output != source) { + std::strcpy(output, source); + } + + for (char* current = output; *current != '\0'; current = CharNextExA(static_cast(g_textCodePage), current, 0)) { + if (*current == '_') { + *current = ' '; + } + } + + return output; +} diff --git a/Source/Client/Session.h b/Source/Client/Session.h index 6c76391..90d7090 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -114,6 +114,8 @@ public: int GetPetHungryState(int hunger); int GetPetEmotionNumber(int job, int action, int hungerLevel); void ClearItemSelection(); + bool IsReducedSkill(int skillId) const; + char* ConvertTooltipText(const char* source, char* output) const; int MercSkillLevel(int skillId) const; int SyncUnknown0E98(); }; diff --git a/Source/Contents/Items/ItemInfo.cpp b/Source/Contents/Items/ItemInfo.cpp index 3ec1bde..9eda18a 100644 --- a/Source/Contents/Items/ItemInfo.cpp +++ b/Source/Contents/Items/ItemInfo.cpp @@ -204,3 +204,10 @@ bool ItemInfo::HasSpecialCard() const { std::memcpy(&card, this->unknown_001C, sizeof(card)); return card == 254 || card == 255; } + +// OFFSET: 0x006D89D0 +// FUNCTION: fn_06603 +bool ItemInfo::IsApprenticeItem() const { + const unsigned id = static_cast(std::atoi(this->itemId.c_str())); + return id - 9001u <= 498u || id - 10000u <= 999u; +} diff --git a/Source/Contents/Items/ItemInfo.h b/Source/Contents/Items/ItemInfo.h index 20be855..ff69dba 100644 --- a/Source/Contents/Items/ItemInfo.h +++ b/Source/Contents/Items/ItemInfo.h @@ -47,6 +47,7 @@ struct alignas(8) ItemInfo { bool SetName(const char* name); void SetItemId(int value); bool HasSpecialCard() const; + bool IsApprenticeItem() const; /* 0000 */ std::uint32_t unknown_0000[4]; /* 0010 */ std::int32_t quantity; /* 0014 */ std::uint32_t unknown_0014[2]; diff --git a/Source/Render/Textures/Texture.cpp b/Source/Render/Textures/Texture.cpp index 214b884..f0dcd32 100644 --- a/Source/Render/Textures/Texture.cpp +++ b/Source/Render/Textures/Texture.cpp @@ -34,6 +34,13 @@ std::uint32_t CTexture::Retain() { return ++this->unknown_001C; } +// OFFSET: 0x005724F0 +// FUNCTION: fn_02473 +std::uint32_t CTexture::Touch() { + this->unknown_0020 = timeGetTime(); + return this->unknown_0020; +} + // OFFSET: 0x005724E0 // FUNCTION: fn_02472 std::uint32_t CTexture::Release() { diff --git a/Source/Render/Textures/Texture.h b/Source/Render/Textures/Texture.h index 0fbf6f7..9399b9b 100644 --- a/Source/Render/Textures/Texture.h +++ b/Source/Render/Textures/Texture.h @@ -29,6 +29,7 @@ public: void StretchTo(RenderPrimitivePool& pool, RenderQueues& queues, int x, int y, int width, int height, bool depthAlpha, float depthStart, float depthEnd); std::uint32_t SetImageSize(std::uint32_t width, std::uint32_t height); std::uint32_t Retain(); + std::uint32_t Touch(); std::uint32_t Release(); int SetName(const char* name);