Jump to content

Metin Stone stackable ?


Go to solution Solved by Mali,

Recommended Posts

Hi, i'm trying to make the metin stones stackable.

If i pick up the stone from the ground it stacks normally on the other stone I have in my inventory, but if I split them and then i try to stack I receive the error that i can't use the stone on this item, like it would be a necklace, bracelet etc..

Do you know what should I change to fix this? Thank you

Link to comment
Share on other sites

  • 6 months later...
  • Honorable Member
  • Solution

1.Make item stackable from proto

2.uiinventory.py:

Find in def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):

		elif item.IsMetin(srcItemVID):
			self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)

Change:

		elif item.IsMetin(srcItemVID) and not item.IsMetin(player.GetItemIndex(dstItemSlotPos)):
			self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)

3.char_item.cpp

Find in case ITEM_METIN:

						ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (METIN)");

Change:

						item->SetCount(item->GetCount() - 1);

 

  • Love 7

 

Link to comment
Share on other sites

2 hours ago, Mali61 said:

1.Make item stackable from proto

2.uiinventory.py:

Find in def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):


		elif item.IsMetin(srcItemVID):
			self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)

Change:


		elif item.IsMetin(srcItemVID) and not item.IsMetin(player.GetItemIndex(dstItemSlotPos)):
			self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)

3.char_item.cpp

Find in case ITEM_METIN:


						ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (METIN)");

Change:


						item->SetCount(item->GetCount() - 1);

 

 

Thank you, all works perfect.

Just one last thing, how can i make that when i try to stack a stone with another stone with the same vnum the background is yellow instead of red?

9C1j0gP.png

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

  • Honorable Member

Find in uiinventory.py - def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos):

		elif item.IsMetin(srcItemVNum):
			if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos):
				return True

Change:

		elif item.IsMetin(srcItemVNum):
			if player.ATTACH_METIN_OK == player.CanAttachMetin(srcItemVNum, dstSlotPos) or (item.IsMetin(player.GetItemIndex(dstSlotPos)) and player.GetItemIndex(dstSlotPos) == srcItemVNum):
				return True

 

  • Love 7

 

Link to comment
Share on other sites

  • 4 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      Moving server from FreeBSD 11.2 to 13.2 - lib needed

    2. 0

      I just implemented some costumes and they are not visible

    3. 0

      Skill Tree Problem

    4. 97

      Ulthar SF V2 (TMP4 Base)

    5. 5

      Client Crashes through Offline Shop (Ikarus)

    6. 5

      VIVY-WORLD2 - FARM TO THE TOP

    7. 0

      ToolTip Bug?

    8. 0

      Skill tree build erorr

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