diff --git a/Source/Client/Session.h b/Source/Client/Session.h index 93327f3..ce6116c 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -93,7 +93,9 @@ public: /* 5558 */ int unknown_5558; /* 555C */ unsigned char unknown_555C[0x47C]; /* 59D8 */ LuaScript* m_hotkeyScript; - /* 59DC */ unsigned char unknown_59DC[0x28C]; + /* 59DC */ unsigned char unknown_59DC[0x218]; + /* 5BF4 */ int m_pairValues[3]; + /* 5C00 */ unsigned char unknown_5C00[0x68]; /* 5C68 */ ItemInfo unknown_5C68[5]; /* 6140 */ std::uint16_t unknown_6140; /* 6144 */ std::map unknown_6144; @@ -124,6 +126,14 @@ public: void ClearUnknown1740(int id); void ClearUnknown1738(int id); std::uint32_t SyncServerTime(std::uint32_t serverTime); + std::pair* InsertPair(int key, int value); + int SetPairValue(int value, int slot); + int SetHotkeyEntry(char enabled, int id, int value, int slot); + int SetFlag(char value); + // INLINED + NormalItemSlot& SkillHotkey(int index) { + return reinterpret_cast(reinterpret_cast(this) + offsetof(CSession, unknown_06EB))[index]; + } int GetPetFood(int job); void GetPetIllustName(int job, int, char* buffer); int GetPetJobByEggItem(int eggItemId); @@ -178,6 +188,7 @@ static_assert(offsetof(SessionRecord6144, unknown_0030) == 0x30); static_assert(offsetof(CSession, m_additionalSkills) == 0x4); static_assert(offsetof(CSession, m_level) == 0x1650); static_assert(offsetof(CSession, m_hotkeyPage) == 0xBC); +static_assert(offsetof(CSession, m_pairValues) == 0x5BF4); static_assert(offsetof(CSession, m_hotkeyDescriptions) == 0xC0); static_assert(offsetof(CSession, m_serverTimeOffset) == 0x794); static_assert(offsetof(CSession, m_serverTimeAdjustCount) == 0x798); diff --git a/Source/Contents/Jobs/JobInheritance.cpp b/Source/Contents/Jobs/JobInheritance.cpp index af3dd15..0baa420 100644 --- a/Source/Contents/Jobs/JobInheritance.cpp +++ b/Source/Contents/Jobs/JobInheritance.cpp @@ -1,9 +1,15 @@ +#include "Client/Mode/ActiveGameMode.h" +#include "Client/Mode/CMode.h" +#include "Contents/Items/ItemDescription.h" +#include "Contents/Skills/SkillInfo.h" #include "Client/Session.h" #include "Contents/Jobs/JobInheritance.h" #include "Contents/Jobs/JobId.h" #include "Contents/Skills/PlayerSkillBundle.h" #include "Script/LuaScript.h" +#include + namespace { // OFFSET: 0x00DFBC00 // FUNCTION: fn_23585 @@ -125,3 +131,61 @@ int __stdcall GetRealWeaponId(int weapon) { } return weapon; } + +// OFFSET: 0x00DFB4B0 + +// OFFSET: 0x00DFBE10 +// FUNCTION: fn_23590 +bool __stdcall IsVisibleJob(int job) { + return job != JT_WARPNPC && job != JT_EFFECTLAUNCHER && job != JT_HIDDEN_NPC; +} + +// OFFSET: 0x00E19230 + +// OFFSET: 0x00E19530 +// FUNCTION: fn_23841 +int __stdcall GetWeaponViewValue(int weapon) { + const int value = FindItemDescription(weapon).unknown_0040; + + if (weapon > 2100 && weapon < 2200 || static_cast(weapon - 28901) <= 0x61 || static_cast(weapon - 460000) <= 0x270F) { + return -1; + } + + return value; +} + +// OFFSET: 0x00E248F0 + +// OFFSET: 0x00E25970 +// FUNCTION: fn_23906 +bool ResetHotkeySlots() { + g_session.m_hotkeyScript->Call("ResetTheHotKey", "dddd", 1, 132, 192, 18); + return g_session.m_hotkeyScript->Call("ResetTheHotKey", "dddd", 1, 135, 36, 18); +} + +// OFFSET: 0x00E25E60 + +// OFFSET: 0x00E25EE0 +// FUNCTION: fn_23910 +int CSession::SetPairValue(int value, int slot) { + if (slot == 0) { + this->m_pairValues[0] = value; + return value; + } + + if (slot == 1) { + this->m_pairValues[1] = value; + return value; + } + + if (slot == 2) { + this->m_pairValues[2] = value; + return value; + } + + return slot; +} + +// OFFSET: 0x00E25F20 + +// OFFSET: 0x00E26030 diff --git a/Source/Contents/Jobs/JobInheritance.h b/Source/Contents/Jobs/JobInheritance.h index ad20291..8382a6f 100644 --- a/Source/Contents/Jobs/JobInheritance.h +++ b/Source/Contents/Jobs/JobInheritance.h @@ -12,4 +12,15 @@ struct JobInheritance { void InitializeSkillTree(CPlayerSkillBundle& bundle, int job); }; +#include +#include + +bool __stdcall IsVisibleJob(int job); +int __stdcall GetWeaponViewValue(int weapon); +int __stdcall GetDualWieldWeaponType(int first, int second); +bool __stdcall IsJobWeaponAllowed(int job, int slot, std::int64_t weapon); +int __stdcall GetRealWeaponId(int weapon); +std::string GetJobTitleString(int job); +bool ResetHotkeySlots(); + #endif