diff --git a/Source/Contents/ItemDBToIDMgr.cpp b/Source/Contents/ItemDBToIDMgr.cpp new file mode 100644 index 00000000..4d05b451 --- /dev/null +++ b/Source/Contents/ItemDBToIDMgr.cpp @@ -0,0 +1,21 @@ +#include "Contents/ItemDBToIDMgr.h" + +#include + +// GLOBAL: gl_24498 +CItemDBToIDMgr* g_itemDbToIdMgr = nullptr; + +// OFFSET: 0x006C7400 + +// OFFSET: 0x006C7450 +// FUNCTION: fn_06416 +void CItemDBToIDMgr::Init() { +} + +// OFFSET: 0x006C74D0 + +// OFFSET: 0x006C7540 + +// OFFSET: 0x006C7670 + +// OFFSET: 0x00E5CE60 diff --git a/Source/Contents/ItemDBToIDMgr.h b/Source/Contents/ItemDBToIDMgr.h new file mode 100644 index 00000000..c2381dc6 --- /dev/null +++ b/Source/Contents/ItemDBToIDMgr.h @@ -0,0 +1,29 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_ITEMDBTOIDMGR_H +#define RAGNAROK_SOURCE_CONTENTS_ITEMDBTOIDMGR_H + +#include "Script/LuaInstance.h" + +#include + +class CItemDBToIDMgr { +public: + CItemDBToIDMgr(); + virtual ~CItemDBToIDMgr(); + + static CItemDBToIDMgr* GetInstance(); + + void Init(); + bool Load(); + int GetItemID(std::string itemDBName); + +protected: + /* 0004 */ CLuaInstance m_lua; +}; + +extern CItemDBToIDMgr* g_itemDbToIdMgr; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(CItemDBToIDMgr) == 12); +#endif + +#endif diff --git a/Source/Script/LuaInstance.h b/Source/Script/LuaInstance.h index 6e8b645f..90e58a9a 100644 --- a/Source/Script/LuaInstance.h +++ b/Source/Script/LuaInstance.h @@ -19,6 +19,7 @@ public: void SetGlobal(const std::string& name, int value); void SetGlobal(const std::string& name, double value); int ReadStrings(std::vector& values, const char* global); + lua_State* GetState() const { return this->m_state; } protected: /* 0004 */ lua_State* m_state; diff --git a/data/compile.json b/data/compile.json index 9109cb11..8dc1d45d 100644 --- a/data/compile.json +++ b/data/compile.json @@ -331,6 +331,7 @@ "Source/Contents/Hotkeys/UserHotkeyMgr.cpp": 4, "Source/Contents/Hotkeys/UserHotkeyScript.cpp": 4, "Source/Contents/InstantVar.cpp": 0, + "Source/Contents/ItemDBToIDMgr.cpp": 4, "Source/Contents/Items/ItemDescription.cpp": 4, "Source/Contents/Items/ItemInfo.cpp": 4, "Source/Contents/Items/ItemLink.cpp": 4,