He intentado durante varios días crear la función para equipar un elemento en el personaje en la temporada, pero aparece un error en la función cuando la reescribo y tiene crash el client.
Debajo de la función descompilada, probada y funcionando, mueve el itempero tiene crash.
char MoveItemTo(DWORD a2, void * a3, int a4)
{
int Window = 0;
int TargetSlot = -1;
int X = *(BYTE*)(pGetItemBMD(a3) + 568);
int Y = *(BYTE*)(pGetItemBMD(a3) + 569);
switch ( a4 )
{
case 1:
{
Window = WindowID(_Inventory);
TargetSlot = (*(int (__thiscall**)(int, DWORD, int))(*(DWORD*)Window + 112))(Window, X, Y);
if ( TargetSlot == -1 )
{
Window = WindowID(_ExtensionBag);
TargetSlot = (*(int (__thiscall **)(int, DWORD, int))(*(DWORD *)Window + 112))(Window, X, Y);
}
}
break;
case 9:
{
Window = WindowID(_Warehouse);
TargetSlot = (*(int(__thiscall**)(int, DWORD, int))(*(DWORD*)Window + 112))(Window, X, Y);
if ( TargetSlot == -1 )
{
Window = WindowID(_WarehouseExt);
TargetSlot = (*(int (__thiscall **)(int, DWORD, int))(*(DWORD*)Window + 112))(Window, X, Y);
}
}
break;
case 6:
Window = WindowID(_Trade);
TargetSlot = (*(int (__thiscall **)(int, DWORD, int))(*(DWORD*)Window + 112))(Window, X, Y);
break;
case 4:
Window = WindowID(_MixInventory1);
TargetSlot = (*(int (__thiscall **)(int, DWORD, int))(*(DWORD*)Window + 112))(Window, X, Y);
break;
case 5:
Window = WindowID(_MixInventory2);
TargetSlot = (*(int (__thiscall **)(int, DWORD, int))(*(DWORD *)Window + 112))(Window, X, Y);
break;
case 11:
Window = WindowID(_EventInventory);
TargetSlot = (*(int (__thiscall **)(int, DWORD, int))(*(DWORD *)Window + 112))(Window, X, Y);
break;
case 12:
Window = WindowID(_PetInventory);
TargetSlot = (*(int (__thiscall **)(int, DWORD, int))(*(DWORD *)Window + 112))(Window, X, Y);
break;
}
if ( TargetSlot != -1 && Window )
{
int SourceSlot = sub_9CA225(a2, (int)a3);
if ( sub_9CB0D1(a2, SourceSlot) )
{
sub_9CA557((void*)a2);
*(BYTE*)(WindowID(_Unknown1) + 137) = 1;
(*(void (__thiscall **)(int, int))(*(DWORD*)Window + 152))(Window, TargetSlot);
return 1;
}
}
return 0;
}
#define pWindowThisNew ((int(*)()) 0x936AAC) //S8 OK
#define WindowID(Window) *(DWORD*)(pWindowThisNew() + Window) //S8 OK
#define sub_9CA225 ((int(__thiscall*)(int a1, int a2)) 0x009CA225)
#define sub_9CB0D1 ((char(__thiscall*)(int a1, int a2)) 0x009CB0D1)
#define sub_9CA557 ((void(__thiscall*)(void * a1)) 0x009CA557)
Podemos ayudarnos mutuamente para crear aquello que incluso sirvió para las nuevas seasons (S13 s14 s15)