-
Member
[HELP] Working with inventory Build: 3.4.2
Greetings, can anyone help with the implementation of work with inventory?
We have the possibility of a repeat (For which many thanks to Razzue)
Code:
//Player offset
public const int Inventory = 0x12408; // Updated
//And
public const int BagSlot1 = 0x130; // Updated
public const int BagSlot2 = 0x140; // Updated
public const int BagSlot3 = 0x150; // Updated
public const int BagSlot4 = 0x160; // Updated
public const int BackpackFirst = 0x170; // Updated
public const int BackpackLast = 0x260; // Updated
It’s a little unclear to me what types to read, I searched the forum for answers and did not find
I understand Inventory = 0x12408; this is an address and reads like [Entry+Inventory]
Then in order to get into the specific bag you need to read [ [Entry+Inventory]+BagSlot4]
Well, we read the cell of a particular bag [ [Entry+Inventory]+BagSlot4]+BackpackLast
If I'm doing everything right, what type should I read in [ [Entry+Inventory]+BagSlot4]+BackpackLast?
and what value should be returned?
or am I doing something wrong?
I need to find out if the last cell in a particular bag is free, but so far I can’t do it(
Last edited by Hrap; 08-28-2023 at 03:38 PM.
-
-
Member
Thank you very much you helped a lot
-
Member
.................................................
Last edited by Hrap; 11-18-2022 at 12:42 PM.
-
Member
Understood everything works)
Last edited by Hrap; 11-18-2022 at 01:31 PM.
-
Member
Originally Posted by
Razzue
Inventory is [PlayerBase + 0xF5C8] in wrath
From inventory you are reading the bag's Guid
Code:
for(var i = 0; i < 4; i++)
var Guid = [PlayerBase + 0xF5C8] + (0x140 + (i * 0x10));
You then get the bag entries from the object manager via guid.
After you get that, items in X bag are at 0x418; (slot count 0x410)
So to count "empty" slots in bags (not including backpack)
Code:
var empty = 0;
for(var a = 0; a < 4; a++)
{
var bag = GetBag("guid from a");
for(var b = 0; b < bag.Slots; b++)
if(bag.Items[b].IsEmpty())
empty++;
}
Hi, how to i get baseadress or guid of backpack?
I also want to know the free cells in it
Last edited by Hrap; 11-22-2022 at 04:47 AM.
-
Member
Originally Posted by
Hrap
Hi, how to i get baseadress or guid of backpack?
I also want to know the free cells in it
AFAIK backpack slots implemented as part of character inventory and placed right after bagslots (not sure about this), so you basically work with them like with bags, but skipping step where you getting bag object.
BTW please start using forum/google search, every question you asked so far was previously answered with copypaste ready code :/
-
Member
thank you all figured it out
Last edited by Hrap; 11-26-2022 at 04:41 PM.
-
Member
Greetings to all, again something has changed in working with inventory, who knows the correct field offset in 3.4.2
I try to use
Code:
InvSlots = 0x12988;
Bagslot1 = 0x1E0;
DWORD_PTR adress = read<DWORD_PTR>(PlayerBase + 0x12988);
GUID First = read<GUID>(adress + 0x1E0);
But I don't get Guid first bag
It seems to me that something is wrong with the offsets
-
Active Member
Originally Posted by
Hrap
Greetings to all, again something has changed in working with inventory, who knows the correct field offset in 3.4.2
I try to use
Code:
InvSlots = 0x12988;
Bagslot1 = 0x1E0;
DWORD_PTR adress = read<DWORD_PTR>(PlayerBase + 0x12988);
GUID First = read<GUID>(adress + 0x1E0);
But I don't get Guid first bag
It seems to me that something is wrong with the offsets
InvSlots = 0x12990 ?
-
Post Thanks / Like - 1 Thanks
Hrap (1 members gave Thanks to imzz for this useful post)
-
Member
Code:
Field_LocalPlayer_Inventory = 0x0000000000012990
this = LocalPlayer ptr
std::vector<wItem*> GetAllBagItems() {
std::vector<wItem*> ItemsArr;
for (int i = 0; i < 4; i++)
{
auto ContainerGuid = this->GetInventory()->GetBagByID(i);
auto entity = GameMethods::getEntityByGuid<wContainer*>(ContainerGuid, GlobalVars::WoW::ContainerObjects);
if (entity->isValid())
{
for (int j = 0; j < entity->GetSlots(); j++)
{
auto ItemGuid = entity->GetSlotById(j);
auto Item = GameMethods::getEntityByGuid<wItem*>(ItemGuid, GlobalVars::WoW::ItemObjects);
if (Item->isValid())
{
ItemsArr.push_back(Item);
}
}
}
}
return ItemsArr;
}
CGGuid GetBagByID(int ID)
{
auto res = *(CGGuid*)((uintptr_t)InventoryPtr+ 0x1E0 + (ID * 0x10)); //+
return res;
}
Last edited by Fakekx; 08-30-2023 at 04:42 PM.
-
Post Thanks / Like - 1 Thanks
Hrap (1 members gave Thanks to Fakekx for this useful post)
-
Member
thank you so much, it turns out I had the wrong offset