Jump to content

Recommended Posts

  • Honorable Member

When you pick up item, its icon will briefly appear next to the chat.
.gif

SERVER

Spoiler

1. Open length.h and search:
srcs/server/common

	CHAT_TYPE_MAX_NUM
};

And above add:

#if defined(__ITEM_DROP_IN_CHAT_BAR__)
	CHAT_TYPE_PICKUP_ITEM,
#endif

 

2. Open service.h (or CommonDefines.h) and add:
srcs/server/common

#define __ITEM_DROP_IN_CHAT_BAR__

 

3. Open input_main.cpp and search:
srcs/server/game

void CInputMain::ItemPickup(LPCHARACTER ch, const char* data)
{
	struct command_item_pickup* pinfo = (struct command_item_pickup*) data;
	if(ch)
		ch->PickupItem(pinfo->vid);
}

And change to:

void CInputMain::ItemPickup(LPCHARACTER ch, const char* data)
{
	struct command_item_pickup* pinfo = (struct command_item_pickup*) data;
	if(ch)
#if defined(__ITEM_DROP_IN_CHAT_BAR__)
		if (ch->PickupItem(pinfo->vid))
		{
			LPITEM item = ITEM_MANAGER::instance().FindByVID(pinfo->vid);
			if (item)
				ch->ChatPacket(CHAT_TYPE_PICKUP_ITEM, "%d", item->GetVnum());
		}

#else
		ch->PickupItem(pinfo->vid);
#endif
}

 

SRCBIN

Spoiler

1. Open Locale_inc.h and add:
UserInterface

#define __ITEM_DROP_IN_CHAT_BAR__

 

2. Open Packet.h and search:
UserInterface

	CHAT_TYPE_MAX_NUM,
};

And above add:

#if defined(__ITEM_DROP_IN_CHAT_BAR__)
	CHAT_TYPE_PICKUP_ITEM,
#endif

 

3. Open PythonApplicationModule.cpp and search:
UserInterface

	PyModule_AddIntConstant(poModule, "CAMERA_STOP",			CPythonApplication::CAMERA_STOP);

And add below:

#if defined(__ITEM_DROP_IN_CHAT_BAR__)
	PyModule_AddIntConstant(poModule, "__ITEM_DROP_IN_CHAT_BAR__", 1);
#endif

 

4. Open PythonChat.cpp and search:
UserInterface

	m_akD3DXClrChat[CHAT_TYPE_BIG_NOTICE]	= D3DXCOLOR(1.0f, 0.902f, 0.730f, 1.0f);

And add below:

#if defined(__ITEM_DROP_IN_CHAT_BAR__)
	m_akD3DXClrChat[CHAT_TYPE_PICKUP_ITEM]	= D3DXCOLOR(1.0f, 0.785f, 0.785f, 1.0f);
#endif

 

5. Open PythonChatModule.cpp and search:
UserInterface

	PyModule_AddIntConstant(poModule, "CHAT_SET_LOG_WINDOW",	1);

And add below:

#if defined(__ITEM_DROP_IN_CHAT_BAR__)
	PyModule_AddIntConstant(poModule, "CHAT_TYPE_PICKUP_ITEM",	CHAT_TYPE_PICKUP_ITEM);
#endif

 

6. Open PythonNetworkStreamPhaseGame.cpp and search:
UserInterface

	if(CHAT_TYPE_COMMAND == kChat.type)
	{
		ServerCommand(buf);
		return true;
	}

And add below:

#if defined(__ITEM_DROP_IN_CHAT_BAR__)
	else if (CHAT_TYPE_PICKUP_ITEM == kChat.type)
	{
		PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_ChatItemDrop", Py_BuildValue("(s)", buf));
		return true;
	}
#endif

 

CLIENTGAME

Spoiler

1. Open game.py and at the end of the file add:
root

	if hasattr(app, "__ITEM_DROP_IN_CHAT_BAR__"):
		def BINARY_ChatItemDrop(self, Data):
			self.interface.wndChat.ShowItem(int(Data))

 

2. Open uichat.py and add at the beginning of the file after the last import:
root

if hasattr(app, "__ITEM_DROP_IN_CHAT_BAR__"):
	import item

Search this:

		scrollBar = ui.ScrollBar()
		scrollBar.AddFlag("float")
		scrollBar.SetScrollEvent(ui.__mem_func__(self.OnScroll))
		self.scrollBar = scrollBar

And add below:

		if hasattr(app, "__ITEM_DROP_IN_CHAT_BAR__"):
			self.ItemDropBackDeco = ui.ImageBox()
			self.ItemDropBackDeco.SetParent(self)
			self.ItemDropBackDeco.SetPosition(-35,0)
			self.ItemDropBackDeco.Hide()

			self.ItemDrop = ui.ImageBox()
			self.ItemDrop.SetParent(self.ItemDropBackDeco)
			self.ItemDrop.SetPosition(2,2)
			self.ItemDrop.Show()

			self.ActualItemDrop = 0
			self.ActualItemDropTime = 0

Search this:

		self.Refresh()
		self.chatInputSet.RefreshPosition() # RTL ˝Ă Ŕ§Äˇ¸¦ Á¦´ë·Î ŔâŔ¸·Á¸é Ŕ§Äˇ °»˝ĹŔĚ ÇĘżäÇĎ´Ů

And add below:

	if hasattr(app, "__ITEM_DROP_IN_CHAT_BAR__"):
		def ShowItem(self, vnum):
			self.ActualItemDrop = vnum
			item.SelectItem(vnum)
			self.ItemDropBackDeco.LoadImage("gui/chat/item_drop_back_deco_"+str(item.GetItemSize()[1])+".tga")
			self.ItemDrop.LoadImage(item.GetIconImageFileName())
			self.ItemDropBackDeco.SetPosition(-39,21-item.GetItemSize()[1]*32)
			self.ActualItemDropTime = app.GetTime()+5
			self.ItemDropBackDeco.Show()

Search this:

	##########
	## Render
	def OnUpdate(self):

And add below:

		if hasattr(app, "__ITEM_DROP_IN_CHAT_BAR__"):
			if self.ActualItemDrop:
				if app.GetTime() > self.ActualItemDropTime:
					self.ActualItemDrop = 0
					self.ItemDropBackDeco.Hide()

 


Finally, download the attached files and place them in your game files folder (root).
Download: 

This is the hidden content, please
 or 
This is the hidden content, please

  • Metin2 Dev 49
  • Good 8
  • muscle 2
  • Love 2
  • Love 37

GhwYizE.gif

Link to comment
https://metin2.dev/topic/33179-displaying-the-icon-of-picked-up-items/
Share on other sites

  • 3 weeks later...

Thanks for sharing, but I have a small problem.
If I throw an item away and pick it up it works fine, when I pick up items from bosses or metins the icons don't show up. Why?
@ Tatsumaru

//Edit
I noticed that the icon doesn't appear when we already have at least 1 item in our inventory. In short, if the item is stackable, the icon doesn't appear. 
Is this how it was supposed to work?

Edited by Typical

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.