Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Well hello everyone again this time I would like to share my decompilation of this function that basically what it does is create a starting object an item equipped in the Character's Inventory, Enjoy it!
Code:
.cpp file
ObjCreateBug gObjCreateBug = (ObjCreateBug)0x004ADF24;
ObjCreatePet gObjCreatePet = (ObjCreatePet)0x0075720C;
void gObjCreatePetEx(int ItemId)
{
int ItemSwitch = *(WORD*)ItemId;
int PetPreview = LODWORD(pPreviewPetThis) + 700;
// ----
switch (ItemSwitch)
{
case ItemId(13, 98):
gObjCreateBug(eBugType::Skeleton, PetPreview + 252, PetPreview, 0, 0);
break;
// ---
case ItemId(13, 99):
gObjCreateBug(eBugType::Unicorn, PetPreview + 252, PetPreview, 0, 0);
break;
}
gObjCreatePet(ItemId);
}
void gObjCreatePetExHook()
{
Utils.SetHook((LPVOID)gObjCreatePetEx,(LPVOID)0x0073684D,ASM::CALL);
Utils.SetHook((LPVOID)gObjCreatePetEx,(LPVOID)0x0075567E,ASM::CALL);
}
Code:
.h file
#define ItemId(x, y) ((x * 512) + y)
#define pPreviewPetThis *(DWORD*)0x07A76A00
#define LODWORD(h) ((DWORD)(__int64(h) & __int64(0xffffffff)))
enum eBugType
{
Skeleton = 7587,
Unicorn = 7588,
};
typedef void (__thiscall *ObjCreatePet)(int ItemId);
extern ObjCreatePet gObjCreatePet;
// --
typedef int (__cdecl *ObjCreateBug)(int BugId, int Arg2, int Arg3, int Arg4, int Arg5);
extern ObjCreateBug gObjCreateBug;
// --
Video test:
https://www.youtube.com/watch?v=svz-aOHXhrc
PS: This is my own code based on original...
I mean.. is not complete decompilation code of original function from main.exe code, but works to add new pets.
PS 2: This code is only to create a temporal preview of every pet or object equipped
(for a complete work with this you must modify your server side & client side gObjMakePreviewCharSet functions)... to generate movement on every model, hp bar for pet and etc, you must use anothers functions from your main.
Credits:
Webzen & Me (Nemesis).
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
You could post the main? or to offset 1:03:11?
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Wooow thanks, i already using this in my s4 project anyway. Man really thanks
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
wrong animation
you should make it work like panda pet and not guardian
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Quote:
Originally Posted by
SmileYzn
Wooow thanks, i already using this in my s4 project anyway. Man really thanks
You could pass the main 1:03:15 clean?
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Quote:
Originally Posted by
NaveMu
You could pass the main 1:03:15 clean?
I uses 1.03.11, sorry.
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Here the same source code but, with offsets for 1.03.11 (Jpn) Protocol:
Source:
Code:
ObjCreateBug gObjCreateBug = (ObjCreateBug)0x004AC2C4;
ObjCreatePet gObjCreatePet = (ObjCreatePet)0x0075574A;
void gObjCreatePetEx(int ItemId)
{
int ItemSwitch = *(WORD*)ItemId;
int PetPreview = LODWORD(pPreviewPetThis) + 700;
switch(ItemSwitch)
{
case ItemId(13,106):
{
gObjCreateBug(eBugType::Unicorn_Pet, PetPreview + 252, PetPreview, 0, 0);
break;
}
case ItemId(13,123):
{
gObjCreateBug(eBugType::Skeleton_Pet, PetPreview + 252, PetPreview, 0, 0);
break;
}
}
gObjCreatePet(ItemId);
}
void gObjCreatePetExHook()
{
Utils.SetHook((LPVOID)gObjCreatePetEx,(LPVOID)0x00734BA6,ASM::CALL);
Utils.SetHook((LPVOID)gObjCreatePetEx,(LPVOID)0x00753C6E,ASM::CALL);
}
Header:
Code:
#ifndef _PETS_H_
#define _PETS_H_
enum eBugType
{
Skeleton_Pet = 7613, // -> Fixed for: ItemId(13,123)
Unicorn_Pet = 7596, // -> Fixed for: ItemId(13,106)
};
typedef void (__thiscall *ObjCreatePet)(int ItemId);
extern ObjCreatePet gObjCreatePet;
typedef int (__cdecl *ObjCreateBug)(int BugId, int Arg2, int Arg3, int Arg4, int Arg5);
extern ObjCreateBug gObjCreateBug;
void gObjCreatePetExHook();
#endif
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Quote:
Originally Posted by
mauro07
Here the same source code but, with offsets for 1.03.11 (Jpn) Protocol:
Source:
Code:
ObjCreateBug gObjCreateBug = (ObjCreateBug)0x004AC2C4;
ObjCreatePet gObjCreatePet = (ObjCreatePet)0x0075574A;
void gObjCreatePetEx(int ItemId)
{
int ItemSwitch = *(WORD*)ItemId;
int PetPreview = LODWORD(pPreviewPetThis) + 700;
switch(ItemSwitch)
{
case ItemId(13,106):
{
gObjCreateBug(eBugType::Unicorn_Pet, PetPreview + 252, PetPreview, 0, 0);
break;
}
case ItemId(13,123):
{
gObjCreateBug(eBugType::Skeleton_Pet, PetPreview + 252, PetPreview, 0, 0);
break;
}
}
gObjCreatePet(ItemId);
}
void gObjCreatePetExHook()
{
Utils.SetHook((LPVOID)gObjCreatePetEx,(LPVOID)0x00734BA6,ASM::CALL);
Utils.SetHook((LPVOID)gObjCreatePetEx,(LPVOID)0x00753C6E,ASM::CALL);
}
Header:
Code:
#ifndef _PETS_H_
#define _PETS_H_
enum eBugType
{
Skeleton_Pet = 7598,
Unicorn_Pet = 7599,
};
typedef void (__thiscall *ObjCreatePet)(int ItemId);
extern ObjCreatePet gObjCreatePet;
typedef int (__cdecl *ObjCreateBug)(int BugId, int Arg2, int Arg3, int Arg4, int Arg5);
extern ObjCreateBug gObjCreateBug;
void gObjCreatePetExHook();
#endif
Excuse the question, but where I can find enum eBugType
{
Skeleton_Pet = 7598,
Unicorn_Pet = 7599,
};
I saw that the .15 is different numbers could give a short explanation? thank you!
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Quote:
Originally Posted by
NaveMu
Excuse the question, but where I can find enum eBugType
{
Skeleton_Pet = 7598,
Unicorn_Pet = 7596,
};
I saw that the .15 is different numbers could give a short explanation? thank you!
Is only the ObjectId bro... -.-!
Small Explain:
ItemId calc = Type * MaxIndex + Index
ObjectId calc = Type * MaxIndex + Index + ItemOffsetInArray(834)
Then... for:
case ItemId(13,106):
{
gObjCreateBug(eBugType::Unicorn_Pet, PetPreview + 252, PetPreview, 0, 0);
break;
}
because is -> ObjectId calc: 13 * 512 + 106 + 834 = Unicorn_Pet = 7596,
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Quote:
Originally Posted by
mauro07
Is only the ObjectId bro... -.-!
Small Explain:
ItemId calc = Type * MaxIndex + Index
ObjectId calc = Type * MaxIndex + Index + ItemOffsetInArray(834)
Then... for:
case ItemId(13,106):
{
gObjCreateBug(eBugType::Unicorn_Pet, PetPreview + 252, PetPreview, 0, 0);
break;
}
because is -> ObjectId calc: 13 * 512 + 106 + 834 = Unicorn_Pet = 7596,
#define pPreviewPetThis *(DWORD*)0x07A76A00
You could post the 1:03:11(jpn)?
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Quote:
Originally Posted by
NaveMu
#define pPreviewPetThis *(DWORD*)0x07A76A00
You could post the 1:03:11(jpn)?
I don't remember (I think that is this: 0x7A723B8)
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
brow a question, after I put in my source that I need to do that to give + "load" in their image on the client?
mine is named "IMP" and the image of IMP ..
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
I'm working (for fun purposses & maybe sell too ^^) on this the lastest days on this:
https://forum.ragezone.com/cache.php...%2FfU0jbU4.jpg
PS: I'm decompiling so much functions from my main.exe to make this :D: hmm.. is COOL guys ? :D:
PS 2: Actually.. I can add any Pet Type.. (I have decompiled Pet Class from main, maybe create a cool System like: Muun xD).
- - - Updated - - -
Dark Wolf Pet (Custom Pet Type Fenrir):
https://forum.ragezone.com/cache.php...%2F9XOD4da.jpg
Blue Dragon Pet (Custom Pet Type Guardian):
https://forum.ragezone.com/cache.php...%2FHKPAuP8.jpg
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
great mauro07, can you share skin wing of MG ? :D
Re: Decompiled gObjCreatePet function from main.exe (1.03.15) eng
Quote:
Originally Posted by
MaxSpeed
great mauro07, can you share skin wing of MG ? :D
sure: https://mega.nz/#!TAAj1IAA!Ou_ZaAkJO...zgVIkrGLFIUwM0