First thing you need to do is find the pointers to the inventory struct that are located in the player class. You can find them by putting a stack of pills in your first slot of your inventory and scanning for the amount of pills in the stack. Once the scan completes remove some pills from the stack and search the new value. This should give you an address to the "count" of the first slot in the first row of your inventory.
Once you have that address add it in cheat engine and "Browse this memory region". Scroll up a bit and find the ItemID(I recommend putting an item in the first slot that you know the ItemID of so you can recognize it easily...Godsend lucky ticket maybe?). This address is the start of the inventory array.
Look through the block of memory here and you will see it starts with the itemid and contains the inventory Row and Slot as well as the "count" of the items if its a stackable item. Then right after is an entry for the next Slot that is currently filled in your inventory.
If you look at the screenshot below you can see outlined in the black is the Entry for Row0 Slot0 of the inventory(ie the first slot in the inventory). It starts with 0x0D 0x04(1037) the ItemID of Godsend lucky tickets.
[Only registered and activated users can see links. Click Here To Register...]
Now in the screenshot above if you look directly after the part outlined in black you will see 0x0D 0x04 again. This is the start of the next inventory slot in that row! You will notice that it now looks like this:
[Only registered and activated users can see links. Click Here To Register...]
Notice the part highlighted in blue and compare it to the data highlighted in black for the first slot. It is now a value of 2(the second slot!).
If you look a little farther down in the first screenshot you will see 0x1F, that is the ItemID for the for the chi pills. Look right after the ItemID and you now see the value is 2(and the chi pills in are in the second row)... aha! So that value represents the row. We already know that the next value represents the Slot in the row(so the chi pills are in Row2 Slot2).
Now you'll notice the next value after the ItemID, Row, and Slot is 0x62. Look again in the first screenshot, you see I have 98 chi pills in Row2 Slot2. What is 98 in hex? 0x62! There we have the item count of stackable items!
Ok now that we have figured out how the inventory works, we want to make all items stack onto 1 single slot right? So we need to make a for loop through all rows/slots in the inventory and set them all to 1 single Row/Slot!
From the screenshots above we determined the following:
Now with the above we have declared a struct for our inventory and casted the address of the first entry in the array to it.
Below we will make a for loop through all slots(64) and set all of their Row/Slots to slot 1.
Simple as that. Within your main loop of your .dll call it like this:
You can also filter specific items and move them to different slots based on what they are like this:
Once you have that address add it in cheat engine and "Browse this memory region". Scroll up a bit and find the ItemID(I recommend putting an item in the first slot that you know the ItemID of so you can recognize it easily...Godsend lucky ticket maybe?). This address is the start of the inventory array.
Look through the block of memory here and you will see it starts with the itemid and contains the inventory Row and Slot as well as the "count" of the items if its a stackable item. Then right after is an entry for the next Slot that is currently filled in your inventory.
If you look at the screenshot below you can see outlined in the black is the Entry for Row0 Slot0 of the inventory(ie the first slot in the inventory). It starts with 0x0D 0x04(1037) the ItemID of Godsend lucky tickets.
[Only registered and activated users can see links. Click Here To Register...]
Now in the screenshot above if you look directly after the part outlined in black you will see 0x0D 0x04 again. This is the start of the next inventory slot in that row! You will notice that it now looks like this:
[Only registered and activated users can see links. Click Here To Register...]
Notice the part highlighted in blue and compare it to the data highlighted in black for the first slot. It is now a value of 2(the second slot!).
If you look a little farther down in the first screenshot you will see 0x1F, that is the ItemID for the for the chi pills. Look right after the ItemID and you now see the value is 2(and the chi pills in are in the second row)... aha! So that value represents the row. We already know that the next value represents the Slot in the row(so the chi pills are in Row2 Slot2).
Now you'll notice the next value after the ItemID, Row, and Slot is 0x62. Look again in the first screenshot, you see I have 98 chi pills in Row2 Slot2. What is 98 in hex? 0x62! There we have the item count of stackable items!
Ok now that we have figured out how the inventory works, we want to make all items stack onto 1 single slot right? So we need to make a for loop through all rows/slots in the inventory and set them all to 1 single Row/Slot!
From the screenshots above we determined the following:
Code:
struct Inventory{ int ItemID; int Row; int Slot; int Count; char Unknown[8]; //Unsure what the last 8 bytes do and don't really care }; Inventory *Inventory1 = (Inventory *)0x11C12FC; //this is the address of the first slot where it stores ItemID. This is the first entry in the array of inventory slots Inventory *Inventory2 = (Inventory *)0x11C18FC; //Address for the first row/slot of Hermit vault, find it the same way as the inventory
Below we will make a for loop through all slots(64) and set all of their Row/Slots to slot 1.
Code:
void InventoryStack() { for(int i = 0; i < 64; i++) { Inventory[i].Row = 0; //First row Inventory[i].Slot = 0; //First slot in the first row Inventory2[i].Row = 0; //Hermit vault Inventory2[i].Slot = 0; } }
Code:
InventoryStack();
Code:
if(Inventory1[i].ItemID == 1108) { Inventory1[i].Row = 2; // Second row Inventory1[i].Slot = 0; // First slot of second row }