Informations
Jump to content

Lorem Ipsum...

Click to Dismiss this Notification
Ładowanie danych...

Recommended Posts

spacer.png

 

In this guide, I will walk you through the steps to implement a fully functional item swapping feature within the inventory system. This implementation has been available since 2021 and I noticed it hasn't been widely shared online, so here is a comprehensive tutorial for everyone. Enjoy!

Overview of Changes

The item swap system enhances how players manage their inventory efficiently. Below are the detailed instructions and code snippets necessary for both the server and binary modifications.

Server Side Modifications

1. Update char.h

Open the char.h file and find this method:

 
This is the hidden content, please

Add the following lines beneath it:

 
This is the hidden content, please

2. Modify Quickslot Definition

Now, locate this line:

 
This is the hidden content, please

Add the following code below it:

 
This is the hidden content, please

3. Function Declarations

Next, search for this function declaration:

 
This is the hidden content, please

And introduce an additional declaration as shown below:

 
This is the hidden content, please

4. Implement the GetItem_NEW Function

In the same file, find the following function:

 
This is the hidden content, please

Add the complete implementation of the GetItem_NEW method above this function:

 
This is the hidden content, please

5. Modify SetItem Logic

Look for this condition:

 
This is the hidden content, please

Replace the line that returns false; with the following code:

 
This is the hidden content, please

Client Side Modifications

1. Update char_quickslot.cpp

Look for this function:

 
This is the hidden content, please

Above this, insert the following code:

 
This is the hidden content, please

2. Update common/service.h

Insert the following line at the end of the file:

 
This is the hidden content, please

Binary Side Modifications

1. Modify locale_inc.h

Add the following lines:

 
This is the hidden content, please

2. Update PythonGridSlotWindow.cpp

Find the function:

 
This is the hidden content, please

Above this function, include:

 
This is the hidden content, please

3. Add Color Feedback for Item Slots

Search for this condition:

 
This is the hidden content, please

Add below:

 
This is the hidden content, please

4. Modify Function Signatures in PythonGridSlotWindow.h

Add the following line:

 
This is the hidden content, please

5. Update Slot Information in PythonSlotWindow.cpp

Find this line:

 
This is the hidden content, please

Add the following line just after it:

 
This is the hidden content, please

Locate the line:

 
This is the hidden content, please

Insert this below it:

 
This is the hidden content, please

 

By following these steps, you have successfully integrated the item swap functionality into your inventory system. This enhancement will greatly improve the player's experience when managing items. Happy coding, and enjoy the new features!

 

Link to comment
Share on other sites


Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

×
×
  • Create New...

Important Information

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.

spacer.png

Disable AdBlock
The popup will be closed in 5 seconds...