diff --git a/Source/Contents/Items/ItemInfo.cpp b/Source/Contents/Items/ItemInfo.cpp index 9eda18a..3805d4a 100644 --- a/Source/Contents/Items/ItemInfo.cpp +++ b/Source/Contents/Items/ItemInfo.cpp @@ -3,6 +3,18 @@ #include #include +// GLOBAL: gl_24720 +unsigned char g_digitCharacters[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + // OFFSET: 0x006D47E0 // FUNCTION: fn_06562 ItemInfo::ItemInfo() { @@ -211,3 +223,31 @@ bool ItemInfo::IsApprenticeItem() const { const unsigned id = static_cast(std::atoi(this->itemId.c_str())); return id - 9001u <= 498u || id - 10000u <= 999u; } + +// OFFSET: 0x006D8920 +// FUNCTION: fn_06601 +bool ItemInfo::IsForgeMaterial() const { + return std::atoi(this->itemId.c_str()) == 1000 || this->IsElementalStone(); +} + +// OFFSET: 0x006D8980 + +// OFFSET: 0x006D8A10 +// FUNCTION: fn_06604 +bool ItemInfo::IsElementalStone() const { + switch (std::atoi(this->itemId.c_str())) { + case 994: + case 995: + case 996: + case 997: + return true; + default: + return false; + } +} + +// OFFSET: 0x006D8A50 +// FUNCTION: fn_06605 +bool ItemInfo::IsAboveItemId600() const { + return std::atoi(this->itemId.c_str()) > 500 && std::atoi(this->itemId.c_str()) > 600; +} diff --git a/Source/Contents/Items/ItemInfo.h b/Source/Contents/Items/ItemInfo.h index ff69dba..a1be2c9 100644 --- a/Source/Contents/Items/ItemInfo.h +++ b/Source/Contents/Items/ItemInfo.h @@ -48,6 +48,9 @@ struct alignas(8) ItemInfo { void SetItemId(int value); bool HasSpecialCard() const; bool IsApprenticeItem() const; + bool IsForgeMaterial() const; + bool IsElementalStone() const; + bool IsAboveItemId600() const; /* 0000 */ std::uint32_t unknown_0000[4]; /* 0010 */ std::int32_t quantity; /* 0014 */ std::uint32_t unknown_0014[2]; @@ -76,6 +79,7 @@ struct alignas(8) ItemInfo { ItemInfo LookupClientItem(const std::list& values, int id, unsigned char requireIdentified); ItemInfo LookupClientItemByIdentity(const std::list& values, std::uint32_t id); +bool IsNumericText(const char* text); #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(ItemInfo) == 248);