Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×
  • 0

Make applicable items stackable directly in inventory


ReFresh

Question

  • Premium

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

  • Answers 7
  • Created
  • Last Reply

Top Posters For This Question

7 answers to this question

Recommended Posts

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

  • 0
  • Premium

@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

  • 0
  • Premium
Posted (edited)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Activity

    1. 2

      Where are those maps/dungeons coming from?

    2. 3

      Press F10 to close the client immediately

    3. 2

      Where are those maps/dungeons coming from?

    4. 2

      Where are those maps/dungeons coming from?

    5. 4

      Visual studio 2022 compiling issue

    6. 1

      Count players function

    7. 64
    8. 1

      Costume shining/costume effect system

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