Jump to content

Recommended Posts

  • VIP

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.

 

https://drive.google.com/file/d/1OZqbHrcS6M_Q2q1-YVOAW4NvnRFt8MmM/view?usp=sharing

  • Love 11
Link to post
		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 post
  • VIP
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 post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Activity

    1. 0

      Visual Studio Code SSH for Freebsd

    2. 6

      Delay in the appearance of monsters on the map

    3. 6

      Delay in the appearance of monsters on the map

    4. 6

      Delay in the appearance of monsters on the map

    5. 6

      Delay in the appearance of monsters on the map

    6. 6

      Delay in the appearance of monsters on the map

    7. 6

      Delay in the appearance of monsters on the map

    8. 6

      Delay in the appearance of monsters on the map

    9. 0

      [C++/Python] Looking for Developer

  • Recently Browsing

    No registered users viewing this page.

Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

×
×
  • 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.