Jump to content

Simple Inventory Expansion


Mali

Recommended Posts

Very easy to make.

Just make a copy of alignment via packet info and also you have full check on source client/server + python module and you can do all what you want with these functions..

And all return value row [name_row] from mysql player.player

	case ITEM_LOCK_INVENTORY:
		SetLockInventory(1);
		
	case ITEM_UNLCOCK_INVENTORY:
		SetLockInventory(0);
#Python
player.GetInventoryLocked() # Result current value from mysql

#Client
int CInstanceBase::GetInventoryLocked()
{
	return m_iInventoryLocked;
}

PyObject * playerGetInventoryLocked(PyObject* poSelf, PyObject* poArgs)
{
	CInstanceBase * ch = CPythonPlayer::Instance().NEW_GetMainActorPtr();
	int iInventoryLocked = 0;

	if (ch) {
		iInventoryLocked = ch->GetInventoryLocked();
	}

	return Py_BuildValue("i", iInventoryLocked);
}

#Server
int CHARACTER::GetInventoryLocked() const
{
	return m_iInventoryLocked;
}

void CHARACTER::SetLockInventory(int iAmount)
{
	m_iInventoryLocked = iAmount;
	UpdatePacket();
}

 

Anyway, good ideea.

Link to comment
Share on other sites

  • Honorable Member
6 hours ago, Tasho said:

Very easy to make ^^

Just make a copy of alignment via packet info and also you have full check on source client/server + python module and you can do all what you want with these functions..

And all return value row [name_row] from mysql player.player


	case ITEM_LOCK_INVENTORY:
		SetLockInventory(1);
		
	case ITEM_UNLCOCK_INVENTORY:
		SetLockInventory(0);

#Python
player.GetInventoryLocked() # Result current value from mysql

#Client
int CInstanceBase::GetInventoryLocked()
{
	return m_iInventoryLocked;
}

PyObject * playerGetInventoryLocked(PyObject* poSelf, PyObject* poArgs)
{
	CInstanceBase * ch = CPythonPlayer::Instance().NEW_GetMainActorPtr();
	int iInventoryLocked = 0;

	if (ch) {
		iInventoryLocked = ch->GetInventoryLocked();
	}

	return Py_BuildValue("i", iInventoryLocked);
}

#Server
int CHARACTER::GetInventoryLocked() const
{
	return m_iInventoryLocked;
}

void CHARACTER::SetLockInventory(int iAmount)
{
	m_iInventoryLocked = iAmount;
	UpdatePacket();
}

 

Anyway, good ideea ^^

:facepalm:unnecessary codes but anoter way;)

  • Love 1

 

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks 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.