- Joined
- Oct 29, 2007
- Messages
- 1,289
- Reaction score
- 1,308
English:
Hi all, good for some time now it is possible for me to draw numbers using one of the methods I could find in my main: 1.03K JPN, of class: Character Inventory, based on Item level. I want to share the code with you.
PS: This is in really a: 'Pseudo-code'... because is lacking me re-make a complete struct or class maybe the: OBJECTSTRUCT from main used on: Arg1 -> 'pObj' from this function.
Spanish:
Hola a todos, bueno desde hace algún tiempo es posible para mi dibujar números utilizando uno de los métodos que pude encontrar en mi main: 1.03K JPN, de la clase del: Inventario del Personaje, basándose en el nivel del Item. Quiero compartir el código con ustedes.
PD: Esto es en realidad un: 'Casi-código'... porque esta faltando me re-hacer una estructura completa o clase quizás la: OBJECTSTRUCT del main usada en el: Arg1 (Argumento 1) -> 'pObj' de esta función.
Bundles.cpp file (with a Custom Class):
Code:
BOOL cBundles::DrawNumber(int pObj) // -> 005146C0
{
int pObject = *(WORD*)pObj; // -> Here I make a: 'pointer' to: Inventory Class Method.
// ----
switch(pObject)
{
case ItemId(12,30):
return TRUE;
break;
case ItemId(12,31):
return TRUE;
break;
case ItemId(12,150):
return TRUE;
break;
case ItemId(12,151):
return TRUE;
break;
case ItemId(12,152):
return TRUE;
break;
case ItemId(12,153):
return TRUE;
break;
case ItemId(12,154):
return TRUE;
break;
case ItemId(12,155):
return TRUE;
break;
case ItemId(12,156):
return TRUE;
break;
default:
return pDrawNumber(pObj) >= 2;
break;
}
}
void cBundles::InitDrawNumber()
{
gToolKit.SetOp((LPVOID)0x0050D089,this->DrawNumber,ASM::CALL);
gToolKit.SetOp((LPVOID)0x007347CE,this->DrawNumber,ASM::CALL);
gToolKit.SetOp((LPVOID)0x007777DF,this->DrawNumber,ASM::CALL);
}
void cBundles::Load()
{
this->InitDrawNumber();
}
Bundles.h file (with a Custom Class and some pointers and defines):
Code:
#ifndef __BUNDLES_H__
#define __BUNDLES_H__
#define ItemId(x, y) ((x * 512) + y)
#define pDrawNumber ((bool(__cdecl*)(int pObj))0x005146C0)
class cBundles
{
public:
void Load();
void InitDrawNumber();
static BOOL DrawNumber(int pObj);
};
extern cBundles gBundles;
#endif
Screenshots:
Attachments
You must be registered for see attachments list