Jump to content

Make applicable items stackable directly in inventory


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! 👊 

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

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

 

Link to comment
Share on other sites

  • 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! 👊 

Link to comment
Share on other sites

  • 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! 👊 

Link to comment
Share on other sites

  • 6 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.