Jump to content
×
×
  • Create New...

Fast Split


Recommended Posts

M2 Download Center

Download Here ( Internal )

 

 

A very fast item split system written by me. A very optimized one. Instead of sending hundered of packets it only sends maybe a dozen max. It is searching algorithm is also better than most split systems. It can do

backward searching.

 

Hidden Content

    Give reaction to this post to see the hidden content.

  • Metin2 Dev 25
  • Love 14
  • Good 8
  • Angry 1
Link to comment
Share on other sites

  • Moon
		if (iSlot >= 0 && iSlot <= INVENTORY_MAX_NUM && bCount >= 0 && bCount <= g_bItemCountLimit)
		{
			LPITEM item = ch->GetInventoryItem(iSlot);

			if (item)
			{
				BYTE bItemCount = item->GetCount();

				TItemPos ItemCell;

				ItemCell.window_type = INVENTORY;
				ItemCell.cell = item->GetCell();

				for (int i = 0; i < (bItemCount / bCount) - 1; ++i)
				{
					int iEmptySlot = ch->GetEmptyInventory(item->GetSize());

					TItemPos DestItemCell;

					DestItemCell.window_type = INVENTORY;
					DestItemCell.cell = iEmptySlot;

					ch->MoveItem(ItemCell, DestItemCell, bCount);
				}
			}
		}

 

With command that using args - (Item Slot & Split Count)

 

I don't know why you copy the Item, but items that can be Split have no Sockets & Bonus random so the copy seems useless (Is just a move from the count of the item).

Edited by HITRON
Link to comment
Share on other sites

On 11/1/2020 at 7:15 PM, HITRON said:
		if (iSlot >= 0 && iSlot <= INVENTORY_MAX_NUM && bCount >= 0 && bCount <= g_bItemCountLimit)
		{
			LPITEM item = ch->GetInventoryItem(iSlot);

			if (item)
			{
				BYTE bItemCount = item->GetCount();

				TItemPos ItemCell;

				ItemCell.window_type = INVENTORY;
				ItemCell.cell = item->GetCell();

				for (int i = 0; i < (bItemCount / bCount) - 1; ++i)
				{
					int iEmptySlot = ch->GetEmptyInventory(item->GetSize());

					TItemPos DestItemCell;

					DestItemCell.window_type = INVENTORY;
					DestItemCell.cell = iEmptySlot;

					ch->MoveItem(ItemCell, DestItemCell, bCount);
				}
			}
		}

 

With command that using args - (Item Slot & Split Count)

 

I don't know why you copy the Item, but items that can be Split have no Sockets & Bonus random so the copy seems useless (Is just a move from the count of the item).

Is this your split function? If it is I'd like to see a video of you trying to split all the items by 1 in a completly empty inventory. And yours doesn't do backward searching. Yeah maybe you can further optimize it without copying the socket and attributes, I haven't tried it tbh.

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

      Looking for Someone to create the queries etc for armors and weapons

    2. 13

      Official Private Shop Search

    3. 944

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

    4. 79

      GUI Teleport System

    5. 0

      inventory slot marking system cant compile

    6. 8

      Inventory Bug

    7. 63

      Metin2 Dev - Changelogs

  • Recently Browsing

    • No registered users viewing this page.

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.