Jump to content

Extend Stack Items


Recommended Posts

On 23/10/2015 at 2:27 AM, xCoRPeR said:

Same with me but ins't becuse of this tutorial, with me was becuse im trying to change max yang but i have to change into database on item_proto>gold and shop_buy_price but im using txt and i change into my dump_proto source this 2 variables to long long and use %lld but nothing happens, look if ins't the same problem with you

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 3
  • Not Good 1
  • Sad 1
  • Good 2
  • Love 3
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
  • 6 months later...
Spoiler

 compile BattleArena.cpp
compile vid.cpp
compile minilzo.cpp
compile FSM.cpp
compile MarkConvert.cpp
compile MarkImage.cpp
In file included from BattleArena.cpp:8:
./regen.h:86:1: error: storage class specified for a member declaration
extern bool     regen_load(const char *filename, long lMapIndex, int bas...
^
./regen.h:87:1: error: storage class specified for a member declaration
extern bool     regen_do(const char* filename, long lMapIndex, int base_...
^
./regen.h:88:1: error: storage class specified for a member declaration
extern bool     regen_load_in_file(const char* filename, long lMapIndex...
^
./regen.h:89:1: error: storage class specified for a member declaration
extern void     regen_free();
^
./regen.h:91:1: error: storage class specified for a member declaration
extern bool     is_regen_exception(long x, long y);
^
./regen.h:92:1: error: storage class specified for a member declaration
extern void     regen_reset(int x, int y);
^
In file included from BattleArena.cpp:9:
In file included from ./questmanager.h:3:
In file included from ./questnpc.h:3:
In file included from ./questpc.h:2:
In file included from ./quest.h:5:
../../../Extern/lua/lua/lua.hpp:1:8: error: expected member name or ';' after
      declaration specifiers
extern "C" {
~~~~~~ ^
In file included from BattleArena.cpp:6:
./char.h:503:7: error: missing '}' at end of definition of 'CHARACTER'
class CHARACTER : public CEntity, public CFSM, public CHorseRider
      ^
./questpc.h:6:1: note: still within definition of 'CHARACTER' here
namespace quest
^
In file included from BattleArena.cpp:6:
./char.h:1047:40: error: use of undeclared identifier 'm_bItemLoaded'
  ...bool                       IsItemLoaded() const    { return m_bItemLoaded; }
                                                              ^
./char.h:1048:28: error: use of undeclared identifier 'm_bItemLoaded'
                void                    SetItemLoaded() { m_bItemLoaded ...
                                                          ^
In file included from BattleArena.cpp:7:
In file included from ./sectree_manager.h:3:
./sectree.h:93:32: error: member access into incomplete type 'SECTREE'
                                auto it_entity = (*it_tree)->m_set_entit...
                                                           ^
./typedef.h:35:7: note: forward declaration of 'SECTREE'
class SECTREE;
      ^
In file included from BattleArena.cpp:7:
In file included from ./sectree_manager.h:3:
./sectree.h:95:35: error: member access into incomplete type 'SECTREE'
                                while (it_entity != (*it_tree)->m_set_en...
                                                              ^
./typedef.h:35:7: note: forward declaration of 'SECTREE'
class SECTREE;
      ^
In file included from BattleArena.cpp:7:
In file included from ./sectree_manager.h:3:
./sectree.h:117:12: error: member access into incomplete type 'SECTREE'
                                sectree->for_each_entity(collector);
                                       ^
./typedef.h:35:7: note: forward declaration of 'SECTREE'
class SECTREE;
      ^
In file included from BattleArena.cpp:7:
In file included from ./sectree_manager.h:3:
./sectree.h:129:24: error: member access into incomplete type 'SECTREE'
                                if ( (*(it_tree++))->for_each_entity_for...
                                                   ^
./typedef.h:35:7: note: forward declaration of 'SECTREE'
class SECTREE;
      ^
In file included from BattleArena.cpp:7:
In file included from ./sectree_manager.h:3:
./sectree.h:186:30: error: comparison of distinct pointer types ('LPSECTREE'
      (aka 'SECTREE *') and 'CHARACTER::SECTREE *')
                                if (entity->GetSectree() != this) {
                                    ~~~~~~~~~~~~~~~~~~~~ ^  ~~~~
In file included from BattleArena.cpp:7:
./sectree_manager.h:78:12: error: member access into incomplete type 'SECTREE'
                                sectree->for_each_entity(collector);
                                       ^
./typedef.h:35:7: note: forward declaration of 'SECTREE'
class SECTREE;
      ^
In file included from BattleArena.cpp:7:
./sectree_manager.h:117:12: error: member access into incomplete type
      'SECTREE_MAP'
                                pSecMap->for_each( rfunc );
                                       ^
./typedef.h:39:7: note: forward declaration of 'SECTREE_MAP'
class SECTREE_MAP;
      ^
In file included from BattleArena.cpp:9:
In file included from ./questmanager.h:3:
In file included from ./questnpc.h:3:
./questpc.h:44:30: error: use of undeclared identifier 'QuestState'
                        typedef map<unsigned int, QuestState>   QuestInfo;
                                                  ^
./questpc.h:45:12: error: 'quest::PC::QuestInfo' (aka 'int') is not a class,
      namespace, or enumeration
                        typedef QuestInfo::iterato...
                                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake: *** [Makefile:96: .obj/BattleArena.o] Error 1
gmake: *** Waiting for unfinished jobs....
 

 

i have this when i compile server Source....

 

i have Fliege v2.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 1 month later...
  • 7 months later...
On 10/17/2015 at 4:52 PM, masodikbela said:

M2 Download Center

This is the hidden content, please
( Internal )

Hi there Devs,

I successfully extended the maximum number of items in a stack, so I'd like to share it. Originally the type of the "count" variables are "BYTE", so the maximum number only 255. I changed this to "WORD" (unsigned short), so now its about 60k.

client

packet.h

Search for this: typedef struct command_item_drop2
then replace this in the struct:


BYTE        count;

to this:


WORD        count;

Then search for this: typedef struct command_item_move
then replace this in the struct:


BYTE num;

To this:


WORD num;

Search for this: typedef struct SShopItemTable
then replace this in the struct:


BYTE		count;

to this:


WORD		count;

Search for this: typedef struct packet_set_item2
then replace this in the struct:


BYTE		count;

to this:


WORD		count;

Then search for this: typedef struct packet_update_item
then replace this in the struct:


BYTE		count;

to this:


WORD		count;


Then search for this: typedef struct SEquipmentItemSet
replace this:


BYTE    count;

to this:


WORD    count;


PythonNetworkPhaseGame.cpp->RecvExchangePacket function

Replace this:


CPythonExchange::Instance().SetItemToSelf(iSlotIndex, exchange_packet.arg1, (BYTE) exchange_packet.arg3);

To this:


CPythonExchange::Instance().SetItemToSelf(iSlotIndex, exchange_packet.arg1, (WORD) exchange_packet.arg3);

and this:


CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (BYTE) exchange_packet.arg3);

to this:


CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (WORD) exchange_packet.arg3);


pythonexchange.cpp:

Replace this:


BYTE CPythonExchange::GetItemCountFromTarget(BYTE pos)

With this:


WORD CPythonExchange::GetItemCountFromTarget(BYTE pos)

Then this:


BYTE CPythonExchange::GetItemCountFromSelf(BYTE pos)

With this:


WORD CPythonExchange::GetItemCountFromSelf(BYTE pos)

And this:


void CPythonExchange::SetItemToTarget(DWORD pos, DWORD vnum, BYTE count)

With this:


void CPythonExchange::SetItemToTarget(DWORD pos, DWORD vnum, WORD count)

And then this:


void CPythonExchange::SetItemToSelf(DWORD pos, DWORD vnum, BYTE count)

With this:


void CPythonExchange::SetItemToSelf(DWORD pos, DWORD vnum, WORD count)


pythonexchange.h

Replace this ones:


		BYTE			GetItemCountFromTarget(BYTE pos);
		BYTE			GetItemCountFromSelf(BYTE pos);
		
		void			SetItemToTarget(DWORD pos, DWORD vnum, BYTE count);
		void			SetItemToSelf(DWORD pos, DWORD vnum, BYTE count);
		
		BYTE					item_count[EXCHANGE_ITEM_MAX_NUM];

To this:


		WORD			GetItemCountFromTarget(BYTE pos);
		WORD			GetItemCountFromSelf(BYTE pos);
		
		void			SetItemToTarget(DWORD pos, DWORD vnum, WORD count);
		void			SetItemToSelf(DWORD pos, DWORD vnum, WORD count);
		
		WORD					item_count[EXCHANGE_ITEM_MAX_NUM];


PythonNetworkStreamPhaseGameItem.cpp

Replace the whole function:


bool CPythonNetworkStream::SendShopSellPacketNew

With this:


typedef struct fckOFF
{
	BYTE		bySlot;
	WORD		byCount;
} TfckOFF;

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

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

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

	Tracef(" SendShopSellPacketNew(bySlot=%d, byCount=%u)\n", bySlot, byCount);

	return SendSequence();
}

Then replace this:


bool CPythonNetworkStream::SendItemMovePacket(TItemPos pos, TItemPos change_pos, BYTE num)
bool CPythonNetworkStream::SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, BYTE byCount)

To this:


bool CPythonNetworkStream::SendItemMovePacket(TItemPos pos, TItemPos change_pos, WORD num)
bool CPythonNetworkStream::SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, WORD byCount)


pythonplayermodule.cpp

Replace the whole function:


PyObject * playerSetItemCount(PyObject* poSelf, PyObject* poArgs)

With this:


PyObject * playerSetItemCount(PyObject* poSelf, PyObject* poArgs)
{
	switch (PyTuple_Size(poArgs))
	{
	case 2:
		{
			int iSlotIndex;
			if (!PyTuple_GetInteger(poArgs, 0, &iSlotIndex))
				return Py_BuildException();

			WORD wCount;
			if (!PyTuple_GetInteger(poArgs, 1, &wCount))
				return Py_BuildException();

			if (0 == wCount)
				return Py_BuildException();

			CPythonPlayer::Instance().SetItemCount(TItemPos (INVENTORY, iSlotIndex), wCount);
			return Py_BuildNone();
		}
	case 3:
		{
			TItemPos Cell;
			if (!PyTuple_GetByte(poArgs, 0, &Cell.window_type))
				return Py_BuildException();

			if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell))
				return Py_BuildException();

			WORD wCount;
			if (!PyTuple_GetInteger(poArgs, 2, &wCount))
				return Py_BuildException();

			CPythonPlayer::Instance().SetItemCount(Cell, wCount);

			return Py_BuildNone();
		}
	default:
		return Py_BuildException();

	}
}

PythonNetworkStreamModule.cpp

Replace the following function:


PyObject* netSendItemMovePacket(PyObject* poSelf, PyObject* poArgs)

With this:


PyObject* netSendItemMovePacket(PyObject* poSelf, PyObject* poArgs)
{
	TItemPos Cell;
	TItemPos ChangeCell;
	int num;

	switch (PyTuple_Size(poArgs))
	{
	case 3:
		if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
			return Py_BuildException();
		if (!PyTuple_GetInteger(poArgs, 1, &ChangeCell.cell))
			return Py_BuildException();
		if (!PyTuple_GetInteger(poArgs, 2, &num))
			return Py_BuildException();
		break;
	case 5:
		{
			if (!PyTuple_GetByte(poArgs, 0, &Cell.window_type))
				return Py_BuildException();
			if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell))
				return Py_BuildException();
			if (!PyTuple_GetByte(poArgs, 2, &ChangeCell.window_type))
				return Py_BuildException();
			if (!PyTuple_GetInteger(poArgs, 3, &ChangeCell.cell))
				return Py_BuildException();
			if (!PyTuple_GetInteger(poArgs, 4, &num))
				return Py_BuildException();
		}
		break;
	default:
		return Py_BuildException();
	}

	CPythonNetworkStream& rkNetStream=CPythonNetworkStream::Instance();
	rkNetStream.SendItemMovePacket(Cell, ChangeCell, (WORD) num);//ez a sor az
	return Py_BuildNone();
}

GameType.h

Search for this: typedef struct packet_item
Then replace this:


BYTE        count;

With this:


WORD        count;

Search for this: typedef struct packet_shop_item
And edit this:


BYTE        count;

to this:


WORD        count;

AbstractPlayer.h

Replace this:


virtual void	SetItemCount(TItemPos itemPos, BYTE byCount) = 0;

With this:


virtual void	SetItemCount(TItemPos itemPos, WORD byCount) = 0;

PythonPlayer.cpp

Replace this:


void CPythonPlayer::SetItemCount(TItemPos Cell, BYTE byCount)

With this:


void CPythonPlayer::SetItemCount(TItemPos Cell, WORD byCount)

PythonPlayer.h

Replace this:


void	SetItemCount(TItemPos Cell, BYTE byCount);

With this:


void	SetItemCount(TItemPos Cell, WORD byCount);

PythonNetworkStream.h

And this:


bool SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, BYTE byCount);
bool SendShopSellPacketNew(BYTE bySlot, BYTE byCount);
bool SendItemMovePacket(TItemPos pos, TItemPos change_pos, BYTE num);

With this:


bool SendSafeBoxItemMovePacket(BYTE bySourcePos, BYTE byTargetPos, WORD byCount);
bool SendShopSellPacketNew(BYTE bySlot, WORD byCount);
bool SendItemMovePacket(TItemPos pos, TItemPos change_pos, WORD num);

Now we are done with the client, you can build it now.

 

server

common/tables.h

Search this: typedef struct SShopItemTable
Then replace this:


BYTE		count;

To this:


WORD		count;

packet.h

Search for this: typedef struct command_item_drop2
Then edit this:


BYTE	count;

To this:


WORD	count;

Then search this:: typedef struct command_item_move
Replace this:


BYTE	count;

With this:


WORD	count;

Then search this: typedef struct packet_item_set
Replace this:


BYTE	count;

To this:


WORD	count;

Search this: typedef struct packet_item_update
Replace this:


BYTE	count;

To this:


WORD	count;

Search this: struct packet_shop_item
Replace this:


BYTE        count;

To this:


WORD        count;

Search this: typedef struct pakcet_view_equip
Then replace this:


BYTE	count;

To this:


WORD	count;


input_main.cpp

Replace this whole function:


int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)

With this:


typedef struct fckOFF
{
	BYTE		bySlot;
	WORD		byCount;
} TfckOFF;

int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
{
	TPacketCGShop * p = (TPacketCGShop *) data;

	if (uiBytes < sizeof(TPacketCGShop))
		return -1;

	if (test_server)
		sys_log(0, "CInputMain::Shop() ==> SubHeader %d", p->subheader);

	const char * c_pData = data + sizeof(TPacketCGShop);
	uiBytes -= sizeof(TPacketCGShop);

	switch (p->subheader)
	{
		case SHOP_SUBHEADER_CG_END:
			sys_log(1, "INPUT: %s SHOP: END", ch->GetName());
			CShopManager::instance().StopShopping(ch);
			return 0;

		case SHOP_SUBHEADER_CG_BUY:
			{
				if (uiBytes < sizeof(BYTE) + sizeof(BYTE))
					return -1;

				BYTE bPos = *(c_pData + 1);
				sys_log(1, "INPUT: %s SHOP: BUY %d", ch->GetName(), bPos);
				CShopManager::instance().Buy(ch, bPos);
				return (sizeof(BYTE) + sizeof(BYTE));
			}

		case SHOP_SUBHEADER_CG_SELL:
			{
				if (uiBytes < sizeof(BYTE))
					return -1;

				BYTE pos = *c_pData;

				sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName());
				CShopManager::instance().Sell(ch, pos);
				return sizeof(BYTE);
			}

		case SHOP_SUBHEADER_CG_SELL2:
			{
				if (uiBytes < sizeof(TfckOFF))
					return -1;
				TfckOFF*p2 = (TfckOFF*)c_pData;
				/*BYTE pos = *(c_pData++);
				WORD count = *(c_pData);*/

				sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
				CShopManager::instance().Sell(ch, p2->bySlot, p2->byCount);
				return sizeof(TfckOFF);
			}

		default:
			sys_err("CInputMain::Shop : Unknown subheader %d : %s", p->subheader, ch->GetName());
			break;
	}

	return 0;
}


shop_manager.cpp

Replace this:


void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount)

To this:


void CShopManager::Sell(LPCHARACTER ch, BYTE bCell, WORD bCount)
 
shop.h

Search this: typedef struct shop_item

Replace this:


BYTE	count;

To this:


WORD	count;

shop_manager.h

Replace this:


void	Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount=0);

To this:


void	Sell(LPCHARACTER ch, BYTE bCell, WORD bCount=0);

char_item.cpp

Replace this:


bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount)

To this:


bool CHARACTER::DropItem(TItemPos Cell, WORD bCount)

Then replace this:


bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)

To this:


bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, WORD count)

And replace this in this function:


count = MIN(200 - item2->GetCount(), count);

To this:


count = MIN(ITEM_MAX_COUNT - item2->GetCount(), count);

Then replace this:


LPITEM CHARACTER::AutoGiveItem(DWORD dwItemVnum, BYTE bCount, int iRarePct, bool bMsg)

To this:


LPITEM CHARACTER::AutoGiveItem(DWORD dwItemVnum, WORD bCount, int iRarePct, bool bMsg)

And replace this in this function:


BYTE bCount2 = MIN(200 - item->GetCount(), bCount);

To this:


WORD bCount2 = MIN(ITEM_MAX_COUNT - item->GetCount(), bCount);

And replace this inside the PickupItem function:


BYTE bCount = item->GetCount();

To this:


WORD bCount = item->GetCount();

And this (still inside this function):


BYTE bCount2 = MIN(200 - item2->GetCount(), bCount);

To this:


WORD bCount2 = MIN(ITEM_MAX_COUNT - item2->GetCount(), bCount);


item.cpp->DWORD CItem::GetCount()

Replace this:


return MIN(m_dwCount, 200);

To this:


return MIN(m_dwCount, ITEM_MAX_COUNT);


safebox.cpp

Replace this:


bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, BYTE count)

To this:


bool CSafebox::MoveItem(BYTE bCell, BYTE bDestCell, WORD count)

Then replace this inside this function:


count = MIN(200 - item2->GetCount(), count);

To this:


count = MIN(ITEM_MAX_COUNT - item2->GetCount(), count);

common/item_lenght.h

Here you can set the maximum number in a stack. Change this as big as you want (between 0 and ~60k)


ITEM_MAX_COUNT				= 200,

(I changed this to 300, just for the test)

char.h

Replace this:


bool			DropItem(TItemPos Cell,  BYTE bCount=0);
bool			MoveItem(TItemPos pos, TItemPos change_pos, BYTE num);
LPITEM			AutoGiveItem(DWORD dwItemVnum, BYTE bCount=1, int iRarePct = -1, bool bMsg = true);

To this:


bool			DropItem(TItemPos Cell,  WORD bCount=0);
bool			MoveItem(TItemPos pos, TItemPos change_pos, WORD num);
LPITEM			AutoGiveItem(DWORD dwItemVnum, WORD bCount=1, int iRarePct = -1, bool bMsg = true);


safebox.h

Replace this:


bool		MoveItem(BYTE bCell, BYTE bDestCell, BYTE count);

To this:


bool		MoveItem(BYTE bCell, BYTE bDestCell, WORD count);

oxevent.cpp

Replace this:


bool COXEventManager::GiveItemToAttender(DWORD dwItemVnum, BYTE count)

To this:


bool COXEventManager::GiveItemToAttender(DWORD dwItemVnum, WORD count)

oxevent.h

Replace this:


bool GiveItemToAttender(DWORD dwItemVnum, BYTE count);

With this:


bool GiveItemToAttender(DWORD dwItemVnum, WORD count);

Now we are done with the server, don't foget to build the db and the gamefile too!


database

We have to do 2 more things:

  • Go to the player database, right click on the item table -> desing table, then edit the count column's type from tinyint to smallint and the lenght from 3 to 4.
  • shop_item table->desing table: edit the count column's type from tinyint to smallint

And we are done ;) I also captured the  "progress" like in my "Expand maximum level" topic, its about 40 minutes long again, its not necessary at all to watch it, but if you are interested about the progress, or you just bored and have 40-50 minute freetime, watch it, if you want ;)

Special thanks to TheSLZ for testing the edits.
If you have any problem/remark/question, or you've just found a bug, feel free to tell/ask it here or in PM.

Have a nice day,
~masodikbela

spacer.png

 

Thanks, works nice and no problems!

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

  • 4 weeks later...
  • 1 month later...
  • 7 months later...
  • 10 months later...

I did everything ok, checked twice the files, still not working. When i log in i am stucked without loading npc's or everything and if i try to write i am disconnected.

Can you help me please? I thought you missed some TABS because i saw spaces instead of tabs on some struct from packet.h client but still no succes.

I updated the tables too. Thanks a lot.

Link to comment
Share on other sites

  • 3 months later...
  • 4 months later...

Hello devs,

 

First of all using martysama serverfiles,

I just added the  extend-stack-items feature, but i seem to have a problem. 

i added the system fully and verified it again.

I've set the ITEM_MAX_COUNT to 1000

But whatever i do, i get 232 stacks max and the items continue to stack and dissapear up to 232, so i am still in the Byte  Limitation segment with the stacks.

In every channel config file i have ITEM_COUNT_LIMIT by default.

What i have tried:

1.1 If i comment the ITEM_COUNT_LIMIT, i have the limit of only 200 stacks.

1.2 If i change from ITEM_COUNT_LIMIT to ITEM_MAX_COUNT , the item max count is not getting called, it is like commenting the item_count_limit, so i am stuck at 200 again.

 

in game/config.cpp i have:

BYTE    g_bItemCountLimit = 200;

and no Item_max_count

 

Tried changing from BYTE    g_bItemCountLimit = 200; to WORD g_bItemCountLimit = 1000; and i can't compile it anymore.

Any ideas? Thank you!

Link to comment
Share on other sites

  • 3 weeks later...
On 5/11/2023 at 3:36 PM, Padulcheck said:

Hello devs,

 

First of all using martysama serverfiles,

I just added the  extend-stack-items feature, but i seem to have a problem. 

i added the system fully and verified it again.

I've set the ITEM_MAX_COUNT to 1000

But whatever i do, i get 232 stacks max and the items continue to stack and dissapear up to 232, so i am still in the Byte  Limitation segment with the stacks.

In every channel config file i have ITEM_COUNT_LIMIT by default.

What i have tried:

1.1 If i comment the ITEM_COUNT_LIMIT, i have the limit of only 200 stacks.

1.2 If i change from ITEM_COUNT_LIMIT to ITEM_MAX_COUNT , the item max count is not getting called, it is like commenting the item_count_limit, so i am stuck at 200 again.

 

in game/config.cpp i have:

BYTE    g_bItemCountLimit = 200;

and no Item_max_count

 

Tried changing from BYTE    g_bItemCountLimit = 200; to WORD g_bItemCountLimit = 1000; and i can't compile it anymore.

Any ideas? Thank you!

I want to help you because someone helped me too, try searching in:
PythonNetworkSteamPhaseGame.cpp there you would think ENABLE_CHANGE_LOOK_SYSTEM

On 5/11/2023 at 3:36 PM, Padulcheck said:

Hello devs,

 

First of all using martysama serverfiles,

I just added the  extend-stack-items feature, but i seem to have a problem. 

i added the system fully and verified it again.

I've set the ITEM_MAX_COUNT to 1000

But whatever i do, i get 232 stacks max and the items continue to stack and dissapear up to 232, so i am still in the Byte  Limitation segment with the stacks.

In every channel config file i have ITEM_COUNT_LIMIT by default.

What i have tried:

1.1 If i comment the ITEM_COUNT_LIMIT, i have the limit of only 200 stacks.

1.2 If i change from ITEM_COUNT_LIMIT to ITEM_MAX_COUNT , the item max count is not getting called, it is like commenting the item_count_limit, so i am stuck at 200 again.

 

in game/config.cpp i have:

BYTE    g_bItemCountLimit = 200;

and no Item_max_count

 

Tried changing from BYTE    g_bItemCountLimit = 200; to WORD g_bItemCountLimit = 1000; and i can't compile it anymore.

Any ideas? Thank you!

example :

        case EXCHANGE_SUBHEADER_GC_ITEM_ADD:
            if (exchange_packet.is_me)
            {
                int iSlotIndex = exchange_packet.arg2.cell;
#ifdef ENABLE_CHANGE_LOOK_SYSTEM //(fix ->BYTE in WORD)
                CPythonExchange::Instance().SetItemToSelf(iSlotIndex, exchange_packet.arg1, (WORD) exchange_packet.arg3, exchange_packet.dwLookVnum);
#else
//#ifdef ENABLE_ITEM_MAX_COUNT_1000 fix
                CPythonExchange::Instance().SetItemToSelf(iSlotIndex, exchange_packet.arg1, (WORD) exchange_packet.arg3);
//#else
                //CPythonExchange::Instance().SetItemToSelf(iSlotIndex, exchange_packet.arg1, (BYTE) exchange_packet.arg3);
//#endif
#endif
                for (int i = 0; i < ITEM_SOCKET_SLOT_MAX_NUM; ++i)
                    CPythonExchange::Instance().SetItemMetinSocketToSelf(iSlotIndex, i, exchange_packet.alValues[i]);
                for (int j = 0; j < ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++j)
                    CPythonExchange::Instance().SetItemAttributeToSelf(iSlotIndex, j, exchange_packet.aAttr[j].bType, exchange_packet.aAttr[j].sValue);
                CPythonExchange::Instance().SetItemEvolutionToSelf(iSlotIndex, exchange_packet.evolution);
            }
            else
            {
                int iSlotIndex = exchange_packet.arg2.cell;
#ifdef ENABLE_CHANGE_LOOK_SYSTEM //(fix ->BYTE in WORD)
                CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (WORD) exchange_packet.arg3, exchange_packet.dwLookVnum);
#else
//#ifdef ENABLE_ITEM_MAX_COUNT_1000 fix
                CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (WORD) exchange_packet.arg3);
//#else
                //CPythonExchange::Instance().SetItemToTarget(iSlotIndex, exchange_packet.arg1, (BYTE) exchange_packet.arg3);
//#endif
#endif

Link to comment
Share on other sites

  • 1 month later...

Hey,

can someone help me here?

Spoiler
SYSERR: Jul 20 10:22:20 :: Boot: shop table size error
SYSERR: Jul 20 10:22:20 :: SpawnEventHelper: cannot get map base position 1
SYSERR: Jul 20 10:22:20 :: SpawnEventHelper: cannot get map base position 3
SYSERR: Jul 20 10:22:20 :: SpawnEventHelper: cannot get map base position 23
SYSERR: Jul 20 10:22:20 :: SpawnEventHelper: cannot get map base position 43

 

I edited the shop_item table in navicat from tinyint to smallint and length to 4 but i got this error even i changed it back to tinyint and length 3... what am i doing wrong here?

  • Good 1
Link to comment
Share on other sites

8 minutes ago, backtop said:

Hey,

can someone help me here?

  Reveal hidden contents
SYSERR: Jul 20 10:22:20 :: Boot: shop table size error
SYSERR: Jul 20 10:22:20 :: SpawnEventHelper: cannot get map base position 1
SYSERR: Jul 20 10:22:20 :: SpawnEventHelper: cannot get map base position 3
SYSERR: Jul 20 10:22:20 :: SpawnEventHelper: cannot get map base position 23
SYSERR: Jul 20 10:22:20 :: SpawnEventHelper: cannot get map base position 43

 

I edited the shop_item table in navicat from tinyint to smallint and length to 4 but i got this error even i changed it back to tinyint and length 3... what am i doing wrong here?

did you set the default to 0? let us know what's wrong with your server, so we can help you 

Edited by DGCStaff
Link to comment
Share on other sites

6 minutes ago, backtop said:

Default is 1 but trying it with 0

Edit: Error still occurs

Player->item (count-smallint-4-default 0)

Player->shop_item(count-smallint-4-default 1)

that's how you have to have it, and if everything goes wrong on your server, it's not from those tables 

Link to comment
Share on other sites

21 minutes ago, DGCStaff said:

Player->item (count-smallint-4-default 0)

yes its set like that

21 minutes ago, DGCStaff said:

Player->shop_item(count-smallint-4-default 1)

same here

21 minutes ago, DGCStaff said:

that's how you have to have it, and if everything goes wrong on your server, it's not from those tables 

both entrys are right... do i miss something in source? 

shop.h

typedef struct shop_item
		{
			DWORD	vnum;		// 아이템 번호
			long	price;		// 가격
			WORD	count;		// 아이템 개수

			LPITEM	pkItem;
			int		itemid;		// 아이템 고유아이디

			shop_item()
			{
				vnum = 0;
				price = 0;
				count = 0;
				itemid = 0;
				pkItem = NULL;
			}
		} SHOP_ITEM;
packet.h

struct packet_shop_item
{   
	DWORD       vnum;
	DWORD       price;
	WORD        count;
	BYTE		display_pos;
	long	alSockets[ITEM_SOCKET_MAX_NUM];
	TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_MAX_NUM];
};

 

Edited by backtop
Link to comment
Share on other sites

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.