Jump to content

ItemName Reneval on the Ground


Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

Hello.

I saw this stuff on this and on another board also with bugs or it was incomplete, and I made it to myself.
Feel free to use it with your brain.

Good to know about this:

  • The name of those items which have attributes will be golden.
  • The skillbook and skillforget items will show the name of skill also.
  • If the item isn't yours than the ownership color will be red instead of yellow.

* Készségkönyv = Skillbook(id:50300)
* Feledés könyve = Skillforget book(id:70037)

PS.: If you have problems with the implementation: start to upgrade your programming knowledges and don't disturb me in private message, I won't answer.
Thank you for understanding.

This is the hidden content, please

  • Metin2 Dev 99
  • kekw 1
  • Eyes 1
  • Think 1
  • Confused 1
  • Good 20
  • Love 3
  • Love 73
Link to comment
Share on other sites

@xP3NG3Rx

 

hdEKpusXQrSF9lIbkFMkWw.png

 

It's that line:

void    CreateItem(DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop = true, long alSockets[ITEM_SOCKET_SLOT_MAX_NUM] = {}, TPlayerItemAttribute aAttrs[ITEM_ATTRIBUTE_SLOT_MAX_NUM] = {});


 

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

  • Premium
20 hours ago, avertuss said:

@xP3NG3Rx

 

hdEKpusXQrSF9lIbkFMkWw.png

 

It's that line:


void    CreateItem(DWORD dwVirtualID, DWORD dwVirtualNumber, float x, float y, float z, bool bDrop = true, long alSockets[ITEM_SOCKET_SLOT_MAX_NUM] = {}, TPlayerItemAttribute aAttrs[ITEM_ATTRIBUTE_SLOT_MAX_NUM] = {});


 

PS.: If you have problems with the implementation: start to upgrade your programming knowledges and don't disturb me in private message, I won't answer.
Thank you for understanding.

Edited by Metin2 Dev
Core X - External 2 Internal


 

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

item.cpp: In member function 'const char* CItem::GetName()':
item.cpp:2354:25: error: 'CMobManager' has not been declared
     const CMob * pMob = CMobManager::instance().Get(dwMobVnum);
                         ^
item.cpp:2356:63: error: invalid use of incomplete type 'const class CMob'
      len = snprintf(szItemName, sizeof(szItemName), "%s", pMob->m_table.szLocaleName);
                                                               ^
In file included from item.cpp:4:0:
char.h:561:7: error: forward declaration of 'const class CMob'
 class CMob;

Link to comment
Share on other sites

  • 5 months later...

Cane help any one?

https://metin2.download/picture/999v6tIfNkXhlkz2DANaFGV8x7VZUIQq/.png

PythonSlotWindow.cpp

void CSlotWindow::SetSlotLevelImage(DWORD dwIndex, CGraphicImage * levelImage)
{
	TSlot * pSlot;
	if (!GetSlotPointer(dwIndex, &pSlot) || !levelImage)
		return;
	assert(NULL == pSlot->pInstanceLevel);
	pSlot->pInstanceLevel = CGraphicImageInstance::New();
	pSlot->pInstanceLevel->SetDiffuseColor(1.0, 1.0, 1.0, 1.0);
	pSlot->pInstanceLevel->SetImagePointer(levelImage);
}

 

Edited by Metin2 Dev
Core X - External 2 Internal

 

 

Link to comment
Share on other sites

  • 7 months later...
  • Premium
5 hours ago, Syriza said:

 

@xP3NG3Rx

@WeedHex

@Abel(Tiger)

After implementing this my Skillbooks in Inventory does not have the skill name anymore.

 

Instead of Sword Aura Skillbook now it is Skillbook just..

 

 

Please guys i need this i implemented everything correct

Rename maybe?


 

Link to comment
Share on other sites

  • Premium

Amazing release! There are even more ways of improving this, as making also a different color if the dropped item belongs to a group member, and also making the Z key only try to iterate through items that belongs to you or a party member of yours (prioritizing yours), this system was a perfect base for my idea! Thank you @xP3NG3Rx!

  • Love 1

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

i will compile client but he says an error. Ok, im trying my 0-8-15 C++ knows.

 

PyObject * itemCreateItem(PyObject * poSelf, PyObject * poArgs)
{
	int iVirtualID;
	if (!PyTuple_GetInteger(poArgs, 0, &iVirtualID))
		return Py_BadArgument();
	int iVirtualNumber;
	if (!PyTuple_GetInteger(poArgs, 1, &iVirtualNumber))
		return Py_BadArgument();

	float x;
	if (!PyTuple_GetFloat(poArgs, 2, &x))
		return Py_BadArgument();
	float y;
	if (!PyTuple_GetFloat(poArgs, 3, &y))
		return Py_BadArgument();
	float z;
	if (!PyTuple_GetFloat(poArgs, 4, &z))
		return Py_BadArgument();
	
	bool bDrop = true;
	PyTuple_GetBoolean(poArgs, 5, &bDrop);

#ifdef ENABLE_EXTENDED_ITEMNAME_ON_GROUND
	CPythonItem::Instance().CreateItem(iVirtualID, iVirtualNumber, x, y, z, bDrop, alSockets, aAttrs);
#else
	CPythonItem::Instance().CreateItem(iVirtualID, iVirtualNumber, x, y, z, bDrop);
#endif

	return Py_BuildNone();
}

this is not released, i'm trying self. But VisualStudio says:

 

C2065    'alSockets' : undeclared identifier    UserInterface   PythonItemModule.cpp

C2065    'aAttrs' : undeclared identifier    UserInterface   PythonItemModule.cpp

 

Can one help me :(

 

Sorry for my bad english.....

 

Thanks.

Link to comment
Share on other sites

  • 1 year later...

hi, thanks for the system. I added them all right.

  • The name of those items which have attributes will be golden. ITS WORK!
  • The skillforget items will show the name of skill also. ITS WORK
  • If the item isn't yours than the ownership color will be red instead of yellow. ITS WORK
     
  • but skillbook name not work. what could be the problem? @xP3NG3Rx
Edited by kaJaMrSimple
Link to comment
Share on other sites

  • 2 months later...

@xP3NG3Rx there is a bug in your code. If a player drops a polymorph item (70104 for example) from the inventory, all players in render distance will be kicked and won't be able to login until the item de-spawns.

Changes to fix this error:

Client/UserInterface/PythonItem.cpp -> Search for funtion void CPythonItem::CreateItem
 

//find:

switch (pItemData->GetType())
	{
		
		case CItemData::ITEM_TYPE_POLYMORPH:
    
    
//replace/modify the whole case statement with/like this
    	case CItemData::ITEM_TYPE_POLYMORPH:
		{
			const char* c_szTmp;
			CPythonNonPlayer& rkNonPlayer = CPythonNonPlayer::Instance();
			//Bugfix -> added if clause so that player-dropped items do not crash the client
			if (rkNonPlayer.GetName(alSockets[0], &c_szTmp))
				len += snprintf(szItemName, sizeof(szItemName), "%s", c_szTmp);
			break;
		}

 

Hope this helps someone

  • Love 1
Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...
  • 3 weeks later...
On 25/5/2022 at 10:22, Avrack said:

Todo funciona bien, justo cuando levanto el libro toma el nombre coreano en lugar del de mi idioma. Alguien sabe como arreglar eso?

.png

You cand open sysser on ch1 and the end you can find korean text, only add on locale_string/translate_lua  or go to your source game and change korean text to your language.

On 15/6/2022 at 20:46, kaanofficial said:

the codes are wrong you stole my time

The system work great, you need adapted a little to your code, the firts time for me doesn't work, because i was need adapted to my code source, try again, or put problems here.

  • Metin2 Dev 2
  • Good 1

KH.jpg

Nicks: Nazox Krone Nagato Yahiko Yakiro
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Link to comment
Share on other sites

  • 1 year later...

Announcements



×
×
  • 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.