Jump to content

Recommended Posts

im have bug DumpProto 

When adding damage rate, collect and unlock
Edit disappears

https://metin2.download/picture/NjGYH8LPwz289DEd49aSfyDAQiTd1Fm0/.png

 

https://metin2.download/picture/4zqOBO54k39RBGcTJUwMpe6iUZtTZsyy/.png

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Think 2
  • Love 1
Link to comment
Share on other sites

  • Contributor

As i remember dump_proto does not save the addon type to the clientside. I don't know why, but it's not needed in clientside anyways. You should not use the reverse dump_proto (unpacker) since you have your txt files. People use that only when they lost their txt file.

If you really want to add the addon type to the clientside too then you should modify your dump_proto.cpp

Search:

col++; //AddonType 

(Line 725 in the default dump_proto.cpp, but it's after the itemTable->bGainSocketPct = atoi(csvTable.AsStringByIndex(col++)); line)

Change it to:  

itemTable->bAddonType = atoi(csvTable.AsStringByIndex(col++));

Search: 

BYTE[TAB]bGainSocketPct; 

Add: 

BYTE[TAB]bAddonType;

[TAB] MEAN TABULATOR KEY!!! For some reason it's important there so make sure you paste it with tabulator.

Search: 

item_table->bGainSocketPct = tempTable->bGainSocketPct;

Add: 

item_table->bAddonType = tempTable->bAddonType;

You may have to do the same in you reverse dump_proto (unpacker) if it's not bundled together.

Edit: Use char instead of BYTE like Owsap said below.

Edited by TMP4
Link to comment
Share on other sites

13 hours ago, TMP4 said:

As i remember dump_proto does not save the addon type to the clientside. I don't know why, but it's not needed in clientside anyways. You should not use the reverse dump_proto (unpacker) since you have your txt files. People use that only when they lost their txt file.

If you really want to add the addon type to the clientside too then you should modify your dump_proto.cpp

Search:

col++; //AddonType 

(Line 725 in the default dump_proto.cpp, but it's after the itemTable->bGainSocketPct = atoi(csvTable.AsStringByIndex(col++)); line)

Change it to:  

itemTable->bAddonType = atoi(csvTable.AsStringByIndex(col++));

Search: 

BYTE[TAB]bGainSocketPct; 

Add: 

BYTE[TAB]bAddonType;

[TAB] MEAN TABULATOR KEY!!! For some reason it's important there so make sure you paste it with tabulator.

Search: 

item_table->bGainSocketPct = tempTable->bGainSocketPct;

Add: 

item_table->bAddonType = tempTable->bAddonType;

You may have to do the same in you reverse dump_proto (unpacker) if it's not bundled together.

Thank you problem
It is not modified
When the
proto locale
Modification does not occur
Did you understand ?
This just happens
while adding
damage rate
Or boss skills
Do you understand what I mean
When I collect
The addition is not modified

Link to comment
Share on other sites

  • Honorable Member

As @TMP4said, Dump Proto does not dump some values to the protos as it isn't needed by the client.

Although your tutorial orientation is correct @TMP4, you have to consider that BYTE is unsigned and it will not dump the correct value of the AddonType since, usually, it holds the value -1 or 0.

So, @ ahmet199, I have made a complete tutorial on how you can add it correctly to your Dump Proto tool and call it from your client.

Dump Proto source.

Spoiler
/// 1. @ Srcs/Tools/Dump Proto/ItemCSVReader.h
// Add
#define DUMP_ITEM_ADDON_TYPE_VALUES

/// 2. @ Srcs/Tools/Dump Proto/dump_proto.cpp
// Search @ TClientItemTable
	BYTE bGainSocketPct;

// Add below
#if defined(DUMP_ITEM_ADDON_TYPE_VALUES)
	char cAddonType;
#endif

/// 3. @ Srcs/Tools/Dump Proto/dump_proto.cpp
// Search @ bool Set_Proto_Item_Table
	col++; // AddonType

// Replace with
#if defined(DUMP_ITEM_ADDON_TYPE_VALUES)
	itemTable->cAddonType = atoi(csvTable.AsStringByIndex(col++));
#else
	col++; // AddonType
#endif

/// 4. @ Srcs/Tools/Dump Proto/dump_proto.cpp
// Search @ bool BuildItemTable
			item_table->bGainSocketPct = tempTable->bGainSocketPct;

// Add below
#if defined(DUMP_ITEM_ADDON_TYPE_VALUES)
			item_table->cAddonType = tempTable->cAddonType;
#endif

 

Client source.

Spoiler
/// 1. @ Srcs/Client/GameLib/ItemData.h
// Search @ TItemTable
		BYTE bGainSocketPct;

// Add below
		char cAddonType;

/// 2. @ Srcs/Client/GameLib/ItemData.h
// Search
	int GetSocketCount() const;

// Add below
	char GetAddonType() const;

/// 3. Srcs/Client/GameLib/ItemData.cpp
// Search
DWORD CItemData::GetIconNumber() const

// Add above
char CItemData::GetAddonType() const
{
	return m_ItemTable.cAddonType;
}

 

Finally, here is how you can get that value from the item module.

Client source.

Spoiler
/// 1. @ Srcs/Client/UserInterface/PythonItemModule.cpp
// Search
PyObject* itemGetIconInstance(PyObject* poSelf, PyObject* poArgs)

// Add above
PyObject* itemGetAddonType(PyObject* poSelf, PyObject* poArgs)
{
	CItemData* pItemData = CItemManager::Instance().GetSelectedItemDataPointer();
	if (!pItemData)
		return Py_BuildException("no selected item data");

	return Py_BuildValue("i", pItemData->GetAddonType());
}

/// 2. @ Srcs/Client/UserInterface/PythonItemModule.cpp
// Search
		{ "GetIconInstance", itemGetIconInstance, METH_VARARGS },

// Add above
		{ "GetAddonType", itemGetAddonType, METH_VARARGS },

 

Root example.

Spoiler
''' 1. @ Client/Root/uiToolTip.py '''
# Search
	def __AppendLimitInformation(self):
		appendSpace = False

# Add below
		self.AppendTextLine("AddonType %d" % (item.GetAddonType()), self.CONDITION_COLOR)

 

 

Edited by Owsap
  • Love 1
  • Love 2
Link to comment
Share on other sites

2 hours ago, Owsap said:

As @TMP4said, Dump Proto does not dump some values to the protos as it isn't needed by the client.

Although your tutorial orientation is correct @TMP4, you have to consider that BYTE is unsigned and it will not dump the correct value of the AddonType since, usually, it holds the value -1 or 0.

So, @ ahmet199, I have made a complete tutorial on how you can add it correctly to your Dump Proto tool and call it from your client.

Dump Proto source.

  Reveal hidden contents
/// 1. @ Srcs/Tools/Dump Proto/ItemCSVReader.h
// Add
#define DUMP_ITEM_ADDON_TYPE_VALUES

/// 2. @ Srcs/Tools/Dump Proto/dump_proto.cpp
// Search @ TClientItemTable
	BYTE bGainSocketPct;

// Add below
#if defined(DUMP_ITEM_ADDON_TYPE_VALUES)
	char cAddonType;
#endif

/// 3. @ Srcs/Tools/Dump Proto/dump_proto.cpp
// Search @ bool Set_Proto_Item_Table
	col++; // AddonType

// Replace with
#if defined(DUMP_ITEM_ADDON_TYPE_VALUES)
	itemTable->cAddonType = atoi(csvTable.AsStringByIndex(col++));
#else
	col++; // AddonType
#endif

/// 4. @ Srcs/Tools/Dump Proto/dump_proto.cpp
// Search @ bool BuildItemTable
			item_table->bGainSocketPct = tempTable->bGainSocketPct;

// Add below
#if defined(DUMP_ITEM_ADDON_TYPE_VALUES)
			item_table->cAddonType = tempTable->cAddonType;
#endif

 

Client source.

  Reveal hidden contents
/// 1. @ Srcs/Client/GameLib/ItemData.h
// Search @ TItemTable
		BYTE bGainSocketPct;

// Add below
		char cAddonType;

/// 2. @ Srcs/Client/GameLib/ItemData.h
// Search
	int GetSocketCount() const;

// Add below
	char GetAddonType() const;

/// 3. Srcs/Client/GameLib/ItemData.cpp
// Search
DWORD CItemData::GetIconNumber() const

// Add above
char CItemData::GetAddonType() const
{
	return m_ItemTable.cAddonType;
}

 

Finally, here is how you can get that value from the item module.

Client source.

  Reveal hidden contents
/// 1. @ Srcs/Client/UserInterface/PythonItemModule.cpp
// Search
PyObject* itemGetIconInstance(PyObject* poSelf, PyObject* poArgs)

// Add above
PyObject* itemGetAddonType(PyObject* poSelf, PyObject* poArgs)
{
	CItemData* pItemData = CItemManager::Instance().GetSelectedItemDataPointer();
	if (!pItemData)
		return Py_BuildException("no selected item data");

	return Py_BuildValue("i", pItemData->GetAddonType());
}

/// 2. @ Srcs/Client/UserInterface/PythonItemModule.cpp
// Search
		{ "GetIconInstance", itemGetIconInstance, METH_VARARGS },

// Add above
		{ "GetAddonType", itemGetAddonType, METH_VARARGS },

 

Root example.

  Reveal hidden contents
''' 1. @ Client/Root/uiToolTip.py '''
# Search
	def __AppendLimitInformation(self):
		appendSpace = False

# Add below
		self.AppendTextLine("AddonType %d" % (item.GetAddonType()), self.CONDITION_COLOR)

 

 

Thank you 
The problem is still there

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 13

      Metin2 Closed Beta Content (2003-2004)

    2. 25

      [SRC] Metin2 on LINUX - The Old Metin2 Project

    3. 2

      United/Club/Midgard serverfiles?

    4. 13

      Metin2 Closed Beta Content (2003-2004)

    5. 13

      Metin2 Closed Beta Content (2003-2004)

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.