Jump to content

Recommended Posts

  • Active+ Member

Hello guys,

someone know how to enable stacking for these item types?

Spoiler
case USE_CHANGE_ATTRIBUTE:
case USE_CHANGE_ATTRIBUTE2 :
case USE_ADD_ATTRIBUTE:
case USE_ADD_ATTRIBUTE2:

 

Should I remove these lines to make it work or it needs some code extension to make it stackable?:

Spoiler
if (item2->GetAttributeSetIndex() == -1)
{
	ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ĽÓĽşŔ» şŻ°ćÇŇ Ľö ľř´Â ľĆŔĚĹŰŔÔ´Ď´Ů."));
	return false;
}

 

Thanks for answers!

Sincerely,

ReFresh

Edited by ReFresh

I'll be always helpful!  😉

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

  • Active+ Member

@HaiosMotan In this case items are stacked only when you drop them to the floor and pick up them again, they aren't stacking in inventory directly.

Edited by ReFresh

I'll be always helpful!  😉

  • Active Member
39 minutes ago, ReFresh said:

@HaiosMotan In this case items are stacked only when you drop them to the floor and pick up them again, they aren't stacking in inventory directly.

uiInventory.py

def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos):

def __CanUseSrcItemToDstItem(self, srcItemVNum, srcSlotPos, dstSlotPos):

search 

USE_CHANGE_ATTRIBUTE

change for both

			elif "USE_CHANGE_ATTRIBUTE" == useType:	
				if self.__CanChangeItemAttrList(dstSlotPos) or srcItemVNum == player.GetItemIndex(dstSlotPos):
					return True
			elif "USE_ADD_ATTRIBUTE" == useType:		
				if self.__CanAddItemAttr(dstSlotPos) or srcItemVNum == player.GetItemIndex(dstSlotPos):
					return True

 

  • Active+ Member

@HaiosMotan Thanks for answer, but I still cannot stack the items. I'm getting error from this condition:

Spoiler
if (item2->GetAttributeSetIndex() == -1)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ĽÓĽşŔ» şŻ°ćÇŇ Ľö ľř´Â ľĆŔĚĹŰŔÔ´Ď´Ů."));
		return false;
	}

 

Should it be removed?

Edited by ReFresh

I'll be always helpful!  😉

  • 1 month later...
  • 7 months later...
  • Active+ Member

One guy told me that this works for him:

Spoiler
elif (item.GetUseType(srcItemVID) == "USE_CHANGE_ATTRIBUTE" or item.GetUseType(srcItemVID) == "USE_ADD_ATTRIBUTE") and player.GetItemIndex(srcItemSlotPos) == player.GetItemIndex(dstItemSlotPos):
			self.__SendMoveItemPacket(srcItemSlotPos, dstItemSlotPos, 0)

But it still doesn't work for me. Anyone knows the complete solution?

Edited by ReFresh

I'll be always helpful!  😉

  • 6 months later...

I found a way to make it work like this on uiinventory.py,

I just check if the destination cell item is the same as the item and I send a move item packet

https://metin2.download/picture/78RJBgaHVxza5t6H9ZO5OTQwJz3jStHE/.png

Edited by Metin2 Dev International
Core X - External 2 Internal

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.