Jump to content

Recommended Posts

Hello, I added special inventory successfully, I receive items where they should be in it, and I added the fixes to be able to move items between special inv and normal, plus the one to sell to NPCs.

Then I added Extended Stack Items, to increase the stacked items from 200 to 2000.

Everything works fine, the items are stacked up to 2000, I can move them between the inventory until we get to the sales section, where when I try to sell an item, regardless of whether it is in special or normal inv, I get disconnected from the server back to login page.

After all the tests I did, I came to the conclusion that the problem could be in the client_SRC file PythonNetworkStreamPhaseGameItem.cpp

The following function was adapted by me so that it meets the conditions for special inv and sell NPC fix ... can someone help me solve this problem?

Spoiler
typedef struct fckOFF
{
	WORD		wSlot;
	WORD		byCount;
} TfckOFF;

bool CPythonNetworkStream::SendShopSellPacketNew(WORD wSlot, WORD byCount, BYTE byType)
{
	if (!__CanActMainInstance())
		return true;

	TPacketCGShop PacketShop;
	PacketShop.header = HEADER_CG_SHOP;
	PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2;
	TfckOFF second;
	second.byCount = byCount;
	second.wSlot = wSlot;

	if (!Send(sizeof(TPacketCGShop), &PacketShop))
	{
		Tracef("SendShopSellPacket Errorn");
		return false;
	}
	if (!Send(sizeof(TfckOFF), &second))
	{
		Tracef("SendShopAddSellPacket Error\n");
		return false;
	}
	if (!Send(sizeof(WORD), &wSlot))
	{
		Tracef("SendShopAddSellPacket Errorn");
		return false;
	}
	if (!Send(sizeof(BYTE), &byCount))
	{
		Tracef("SendShopAddSellPacket Errorn");
		return false;
	}
	if (!Send(sizeof(BYTE), &byType))
	{
		Tracef("SendShopAddSellPacket Errorn");
		return false;
	}

	Tracef(" SendShopSellPacketNew(wSlot=%d, byCount=%u, byType=%d)n", wSlot, byCount, byType);

	return SendSequence();
}

 

 

Also with the below function which is the function from NPC sell fix from special inventory the server works fine but i can't sell anything to NPC and the above function is the one adapted by me.
 

Spoiler
bool CPythonNetworkStream::SendShopSellPacketNew(WORD wSlot, WORD byCount, BYTE byType)
{
	if (!__CanActMainInstance())
		return true;

	TPacketCGShop PacketShop;
	PacketShop.header = HEADER_CG_SHOP;
	PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2;

	if (!Send(sizeof(TPacketCGShop), &PacketShop))
	{
		Tracef("SendShopSellPacket Errorn");
		return false;
	}
	if (!Send(sizeof(WORD), &wSlot))
	{
		Tracef("SendShopAddSellPacket Errorn");
		return false;
	}
	if (!Send(sizeof(BYTE), &byCount))
	{
		Tracef("SendShopAddSellPacket Errorn");
		return false;
	}
	if (!Send(sizeof(BYTE), &byType))
	{
		Tracef("SendShopAddSellPacket Errorn");
		return false;
	}

	Tracef(" SendShopSellPacketNew(wSlot=%d, byCount=%d, byType=%d)n", wSlot, byCount, byType);

	return SendSequence();
}

 

 

Edited by waLkerWEED
  • Metin2 Dev 1
  • Love 2

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.