Jump to content

Official Inventory Expansion


Recommended Posts

  • Forum Moderator
vor 3 Stunden schrieb 3bd0:

can you share your "checkspace" in exchange.cpp

Spoiler

bool CExchange::CheckSpace()
{
#ifdef __4_INVENTORY_PAGES__
	BYTE page_count = 4;
#else
	BYTE page_count = 2;
#endif
	static CGrid s_grid1(5, INVENTORY_MAX_NUM / 5 / page_count);
	static CGrid s_grid2(5, INVENTORY_MAX_NUM / 5 / page_count);
	static CGrid s_grid3(5, INVENTORY_MAX_NUM / 5 / page_count);
	static CGrid s_grid4(5, INVENTORY_MAX_NUM / 5 / page_count);

	s_grid1.Clear();
	s_grid2.Clear();
	s_grid3.Clear();
	s_grid4.Clear();

	LPCHARACTER	victim = GetCompany()->GetOwner();
	LPITEM item;

	int i;

	for (i = 0; i < INVENTORY_MAX_NUM / page_count; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid1.Put(i, 1, item->GetSize());
	}
	for (i = INVENTORY_MAX_NUM / page_count; i < (INVENTORY_MAX_NUM / page_count) * 2; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid2.Put(i - INVENTORY_MAX_NUM / page_count, 1, item->GetSize());
	}
	for (i = (INVENTORY_MAX_NUM / page_count) * 2; i < (INVENTORY_MAX_NUM / page_count) * 3; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid3.Put(i - (INVENTORY_MAX_NUM / page_count) * 2, 1, item->GetSize());
	}
	for (i = (INVENTORY_MAX_NUM / page_count) * 3; i < (INVENTORY_MAX_NUM / page_count) * 4; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid4.Put(i - (INVENTORY_MAX_NUM / page_count) * 3, 1, item->GetSize());
	}
	
	static std::vector <WORD> s_vDSGrid(DRAGON_SOUL_INVENTORY_MAX_NUM);
	bool bDSInitialized = false;
	for (i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
	{
		if (!(item = m_apItems[i]))
			continue;

#ifdef NEW_ADD_INVENTORY
		int envanterblack;
		if (item->IsDragonSoul())
			envanterblack = victim->GetEmptyDragonSoulInventory(item);
		else
			envanterblack = victim->GetEmptyInventory(item->GetSize());

		if (envanterblack < 0)
		{
			return false;
		}
#endif

		if (item->IsDragonSoul())
		{
			if (!victim->DragonSoul_IsQualified())
			{
				return false;
			}

			if (!bDSInitialized)
			{
				bDSInitialized = true;
				victim->CopyDragonSoulItemGrid(s_vDSGrid);
			}

			bool bExistEmptySpace = false;
			WORD wBasePos = DSManager::instance().GetBasePosition(item);
			if (wBasePos >= DRAGON_SOUL_INVENTORY_MAX_NUM)
				return false;

			for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; i++)
			{
				WORD wPos = wBasePos + i;
				if (0 == s_vDSGrid[wBasePos])
				{
					bool bEmpty = true;
					for (int j = 1; j < item->GetSize(); j++)
					{
						if (s_vDSGrid[wPos + j * DRAGON_SOUL_BOX_COLUMN_NUM])
						{
							bEmpty = false;
							break;
						}
					}
					if (bEmpty)
					{
						for (int j = 0; j < item->GetSize(); j++)
						{
							s_vDSGrid[wPos + j * DRAGON_SOUL_BOX_COLUMN_NUM] =  wPos + 1;
						}
						bExistEmptySpace = true;
						break;
					}
				}
				if (bExistEmptySpace)
					break;
			}
			if (!bExistEmptySpace)
				return false;
		}
		else
		{
			int iPos = s_grid1.FindBlank(1, item->GetSize());
			if (iPos >= 0)
			{
				s_grid1.Put(iPos, 1, item->GetSize());
			}
			else
			{
				iPos = s_grid2.FindBlank(1, item->GetSize());
				if (iPos >= 0)
				{
					s_grid2.Put(iPos, 1, item->GetSize());
				}
				else
				{
					iPos = s_grid3.FindBlank(1, item->GetSize());
					if (iPos >= 0)
					{
						s_grid3.Put(iPos, 1, item->GetSize());
					}
					else
					{
						iPos = s_grid4.FindBlank(1, item->GetSize());
						if (iPos >= 0)
						{
							s_grid4.Put(iPos, 1, item->GetSize());
						}
						else
						{
							return false;
						}
					}
				}
			}
		}
	}
	return true;
}

 


Best regards
Raylee

Link to comment
Share on other sites

Hi!

I have the latest update of this system from metin2dev. Everything works, but I found a bug I have two pages full of equipment and one bar unlocked on the third page On the third page I have a necklace, and four slots free. If a given person gives me five things, I will only get four things. It should be that the necklace goes to the person and I receive these five things. Will someone help me?

This is my Exchange.cpp

https://pastebin.com/AAMMXfkk

  • Scream 1
  • Love 1
Link to comment
Share on other sites

On 16-4-2017 at 4:27 PM, mikee01212 said:

Whats the Problem

 


SYSERR: Apr 16 16:26:00.44736 :: DirectQuery: AsyncSQL::DirectQuery : mysql_query error: Field 'envanter' doesn't have a default value
query: INSERT INTO player (id, account_id, name, level, st, ht, dx, iq, job, voice, dir, x, y, z, hp, mp, random_hp, random_sp, stat_point, stamina, part_base, part_main, part_hair, part_sash, gold, playtime, skill_level, quickslot) VALUES(0, 1, 'mka', 1, 4, 3, 6, 3, 5, 0, 0, 957592, 255296, 0, 770, 260, 0, 0, 0, 800, 0, 0, 0, 0, 0, 0, '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
SYSERR: Apr 16 16:26:00.45231 :: __QUERY_PLAYER_CREATE: QUERY_ERROR: UPDATE player_index SET pid2=0 WHERE id=1

 

problem solved :)

How you fix this? 

 

and i have this probleem .

Quote


SYSERR: Mar  4 20:30:47 :: DirectQuery: AsyncSQL::DirectQuery : mysql_query error: Field 'gem' doesn't have a default value
query: INSERT INTO player  (id, account_id, name, level, st, ht, dx, iq, job, voice, dir, x, y, z, hp, mp, random_hp, random_sp, stat_point, stamina, part_base, part_main, part_hair, part_sash, gold, envanter, cheque, playtime, skill_level, quickslot) VALUES(0, 10000, 'eeeze', 1, 4, 3, 6, 3, 1, 0, 0, 957312, 254923, 0, 770, 260, 0, 0, 0, 800, 0, 0, 0, 0, 0, 0, 0, 0, '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
SYSERR: Mar  4 20:30:47 :: __QUERY_PLAYER_CREATE: QUERY_ERROR: UPDATE player_index  SET pid2=0 WHERE id=10000

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Forum Moderator
vor 13 Stunden schrieb acidutssu:

Hi , i have problem !! 

InventoryWindow.LoadWindow.BindObject - <type 'exceptions.KeyError'>:'cover_open_0'

Looks that you forgot the "3.Client\ymir work\ui\" part.
Be sure, that your filepart is true.
You can check the true filepart in inventorywindow.py.

Best regards
Raylee
 

Link to comment
Share on other sites

  • 3 weeks later...

 

Fix this problem

DirectQuery: AsyncSQL::DirectQuery : mysql_query error: Field 'envanter' doesn't have a default value

Open Navicat > player -- > player -- > Query Table And

Paste this code

ALTER TABLE `player`
ADD COLUMN `envanter` int(11) NOT NULL DEFAULT '0' AFTER `gold`;

And Go to player -- > player_deleted -- > Query Table And

Paste this code

ALTER TABLE `player_deleted`
ADD COLUMN `envanter` int(11) NOT NULL DEFAULT '0' AFTER `gold`;

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Gold

@Mali61 When I used the key and I have opened all slots I got 3 popout dialogs after yourself.

Dialogs for yes selection:

1st dialog translation  - To open next slot you need none x keys - so it can't detect how many keys you need to open slot because you have already opened all slots

2nd dialog translation - You have already opened all slots. (was really hard to see in the video because it disappeared fast - but you can make video slower on youtube)

3rd dialog translation - You don't have needed amount of keys to open next slot

4th dialog translation - You have already opened all slots.

Dialog for no selection:

1st dialog translation - To open next slot you need none x keys - so it can't detect how many keys you need to open slot because you have already opened all slots

2th dialog translation - You have already opened all slots.

PS: No erros in sysser.

Video:

Spoiler

 

 

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Honorable Member
16 hours ago, ReFresh said:

@Mali61 When I used the key and I have opened all slots I got 3 popout dialogs after yourself.

Dialogs for yes selection:

1st dialog translation  - To open next slot you need none x keys - so it can't detect how many keys you need to open slot because you have already opened all slots

2nd dialog translation - You have already opened all slots. (was really hard to see in the video because it disappeared fast - but you can make video slower on youtube)

3rd dialog translation - You don't have needed amount of keys to open next slot

4th dialog translation - You have already opened all slots.

Dialog for no selection:

1st dialog translation - To open next slot you need none x keys - so it can't detect how many keys you need to open slot because you have already opened all slots

2th dialog translation - You have already opened all slots.

PS: No erros in sysser.

Video:

  Reveal hidden contents

 

 

Fixed and added english lc (change uiinventory, game.py locale_game.txt)

  • Love 1

 

Link to comment
Share on other sites

  • Honorable Member
9 minutes ago, ReFresh said:

@Mali61 You change it to no popout dialog when all slots are already opened?

yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeessssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss I said fixed

  • Love 1

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Gold

@Mali61 I don't know if this bug is caused by your system but when you have full inventory and want to pick up some item the error output in chat is shown 4 times instead of one time.

Error output in chat is:

Your inventory is full.

Your inventory is full.

Your inventory is full.

Your inventory is full.

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Premium
6 hours ago, ReFresh said:

@Mali61 I don't know if this bug is caused by your system but when you have full inventory and want to pick up some item the error output in chat is shown 4 times instead of one time.

Error output in chat is:

Your inventory is full.

Your inventory is full.

Your inventory is full.

Your inventory is full.

You added it wrong, nothing unusual about you.

  • Love 1


 

Link to comment
Share on other sites

  • 1 month later...
  • Premium

Did anyone else experience a problem with expansions dissapearing after like 10 minutes of players inactivity? It gets saved in database succesfully, but then if a player logs off, expansions will dissapear and you will have to unlock them once again. Records in database do not get deleted, but they do reset once the player unlocks 1st expansion for the 2nd time.

Edit: Issue was laying in ClientManagerPlayer.cpp ;) 

Link to comment
Share on other sites

  • 2 weeks later...
On 6/24/2018 at 12:24 PM, Sonitex said:

Did anyone else experience a problem with expansions dissapearing after like 10 minutes of players inactivity? It gets saved in database succesfully, but then if a player logs off, expansions will dissapear and you will have to unlock them once again. Records in database do not get deleted, but they do reset once the player unlocks 1st expansion for the 2nd time.

Edit: Issue was laying in ClientManagerPlayer.cpp ;) 

Can you point out where please?:)

Link to comment
Share on other sites

  • 3 months later...

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.