Jump to content

l3Ul3Y

Inactive Member
  • Posts

    2
  • Joined

  • Last visited

  • Feedback

    0%

About l3Ul3Y

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

l3Ul3Y's Achievements

Apprentice

Apprentice (3/16)

  • One Year In
  • One Month Later
  • Conversation Starter
  • First Post
  • Dedicated

Recent Badges

5

Reputation

  1. By default, wearflags in Metin2 are limited to 32-bit, limiting you to 32 wearflags. To support additional flags, the underlying type must be updated to uint64_t. Run this SQL query in your database: ALTER TABLE item_proto MODIFY wearflag BIGINT UNSIGNED NOT NULL DEFAULT 0; common/item_length.h: // Convert the enum to use uint64_t and make sure to use 1ULL shifts enum EItemWearableFlag : uint64_t { WEARABLE_BODY = (1ULL << 0), // replace 1 with 1ULL and so on... ..., } common/tables.h // change: DWORD dwWearFlags; // to: uint64_t dwWearFlags; // to make less changes, we can just keep the variable name as dwWearFlags game/item.h: // change: DWORD GetWearFlag() { return m_pProto ? m_pProto->dwWearFlags : 0; } // to: uint64_t GetWearFlag() { return m_pProto ? m_pProto->dwWearFlags : 0; } GameLib/ItemData.h: // Convert the enum to use uint64_t and make sure to use 1ULL shifts enum EItemWearableFlag : uint64_t { WEARABLE_BODY = (1ULL << 0), ..., } // change: DWORD dwWearFlags; // to: uint64_t dwWearFlags; // to make less changes, we can just keep the variable name as dwWearFlags // change: BOOL IsWearableFlag(DWORD dwFlag) const; // to: BOOL IsWearableFlag(uint64_t dwFlag) const; // change: DWORD GetWearFlags() const; // to: uint64_t GetWearFlags() const; GameLib/ItemData.cpp: // change: BOOL CItemData::IsWearableFlag(DWORD dwFlag) const // to: BOOL CItemData::IsWearableFlag(uint64_t dwFlag) const // change: DWORD CItemData::GetWearFlags() const to: uint64_t CItemData::GetWearFlags() const UserInterface/PythonItemModule.cpp: // If you are adding a WEARABLE_XXX constant for python that exceed 2^31, change: PyModule_AddIntConstant(poModule, "WEARABLE_XXX", CItemData::WEARABLE_XXX); // to: PyObject* pyValue = PyLong_FromUnsignedLongLong(static_cast<uint64_t>(CItemData::WEARABLE_XXX)); PyModule_AddObject(poModule, "WEARABLE_XXX", pyValue); db/ProtoReader.cpp: / change: int get_Item_WearFlag_Value(string inputString) // to: uint64_t get_Item_WearFlag_Value(std::string inputString) // change: int retValue = 0; // to: uint64_t retValue = 0; // change: retValue = retValue + pow((float)2,(float)i); // to: retValue |= (1ULL << i); // add after int dataArray[35]; uint64_t wearFlags = 0; // change: dataArray[i] = get_Item_WearFlag_Value(csvTable.AsStringByIndex(col)); validCheck = dataArray[i]; // to: wearFlags = get_Item_WearFlag_Value(csvTable.AsStringByIndex(col)); dataArray[i] = 0; validCheck = 0; // change: itemTable->dwWearFlags = dataArray[7]; // to: itemTable->dwWearFlags = wearFlags; db/ProtoReader.h: // change: int get_Item_WearFlag_Value(std::string inputString); // to: uint64_t get_Item_WearFlag_Value(std::string inputString); db/ClientManagerBoot.cpp: // change: str_to_number(item_table->dwWearFlags, data[col++]); // to: item_table->dwWearFlags = strtoull(data[col++], nullptr, 10); If you use dump_proto: dump_proto.cpp: // change: DWORD dwWearFlags; // to: uint64_t dwWearFlags; // change: fprintf(stdout, "ITEM #%-5u %-24s %-24s VAL: %1d %ld %ld %ld %ld %ld WEAR %u ANTI %u IMMUNE %u REFINE %u\n", // to: fprintf(stdout, "ITEM #%-5u %-24s %-24s VAL: %ld %ld %ld %ld %ld %ld WEAR %I64u ANTI %u IMMUNE %u REFINE %u\n", ItemCSVReader.h: // change: int get_Item_WearFlag_Value(std::string inputString); // to: uint64_t get_Item_WearFlag_Value(std::string inputString); ItemCSVReader.cpp: // change: int get_Item_WearFlag_Value(std::string inputString) // to: uint64_t get_Item_WearFlag_Value(std::string inputString) // change: int retValue = 0; // to: uint64_t retValue = 0; // change: retValue = retValue + pow((float)2,(float)i); // to: retValue |= (1ULL << i); If you use mysql2proto: mysql2proto.cpp: // change: str_to_number(pItemTable->dwWearFlags, data[col++]); // to: pItemTable->dwWearFlags = strtoull(data[col++], nullptr, 10);
      • 5
      • Love
      • Good
  2. If you're working with .txt, the FLAG for stackable items is "ITEM_STACKABLE". But i would recommend to only work with the db and use Mysql2Proto, in that case the FLAG for stackable items is "4". (research how a bitmask is working) Either way you have to make sure your proto is equal clientside & serverside.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.