, i havent read the entire thread but, thanks to him for giving a detailed description for the pick pet function, i was able to kind of replacing the function using devkit.the function responsible for returning the item is a boolean function returns either 0 or 1, it loops through the items and finds one based at your pet settings.
my aim was to always return 0, while handling the function and the rest of the pick mechanism..
the first thing you would want to start with is hooking the function
Code:
replaceOffset(0x008AFCF9,addr_from_this(&CDropItemManager::sub_8AF7F0));
inside the function you will find all information needed to filter the item based at current pet settings and the new custom settings that you will create.
this function is being called as long as you have a pet spawned and the pet is enabled, so you may make some flag when you send the pick packet and release it when you receive a reply from the server
all the datas are provided as offsets , recommending to populate your devkit classes with them not to look weirdo as me
Code:
int CDropItemManager::sub_8AF7F0(char a2,UINT16 a3,int a4,DWORD a5)
{
int petUniqueID = *(int *) ((DWORD32) (a4 - 0x6C0) + 0xF8);
for (std::map<int, CIObject *>::iterator it = g_pGfxEttManager->entities.begin();
it != g_pGfxEttManager->entities.end(); ++it) {
//TODO REPLACE STRING COMPARISON WITH isSame Function
if (!strcmp(it->second->GetRuntimeClass()->m_lpszClassName, "CIItem")) {
CIItem* item = (CIItem*) it->second;
if(a2 == 192)
//pick all (nothing)
if(a2 == 193)
//pick all (gold only)
if(a2 == 194)
//pick all (equipements only)
if(a2 == 196)
//pick all (other items only)
if(a2 == 198)
//pick all (other items and equipements)
if(a2 == 199)
//pick all (gold, equipements and other items)
//by logic you should know that for picking something like gold , equipements = 192 + 1 + 2
if(a2 == 128)
//pick only my (nothing)
if(a2 == 129)
//pick only my (gold only)
if(a2 == 130)
//pick only my (equipements only)
//and so on
int refObjID = *(int *) ((int) (it->second) + 0x21C); //item refobjid
int uniqueID = *(int *) ((int) (it->second) + 0xF8); //item uniqueid
const CItemData::SData *data = &g_CGlobalDataManager->GetItemData(refObjID);
//you can get from here other informations needed like codename,typeids so that you can filter the item
if(item->m_bPickAbbilty != 0)
continue;
//checking if the owner was the player && settings is only me
if(item->hasOwner && a2 > 127 && a2 < 139)
{
if(item->SomeCheckForPlayerOwnerName != *(int *) ((int) (g_pCICPlayer)) + 0x2094);
continue;
}
continue;
}
}
return 0;
}
Code:
#pragma once
#include "IGIDObject.h"
class CIItem : public CIGIDObject {
GFX_DECLARE_DYNAMIC_EXISTING(CIItem,0x00EF1C28)
public:
byte hasOwner; //0x254
char pad_0255[0x3]; //0x255
int SomeCheckForPlayerOwnerName; //0x258;
char pad_025C[0x30]; //0x25C
int m_bPickAbbilty; //0x28C
char pad_0290[0x1C]; //0x290
BEGIN_FIXTURE()
ENSURE_SIZE(0x2AC)
END_FIXTURE()
RUN_FIXTURE(CIItem)
};






