Code:
void FullRecover()
{
UINT_PTR adr = 0x004A5570; //Old address
__asm
{
CALL adr
}
}
This is the function that I used to trigger the Full Recovery option in the game with my bot.
The function I used to tell the bot when to use the function is pretty much the way you would make an Autopiller, but instead of calling a function to use pills you just call the FullRecovery function:
Code:
bool rec;
float HPPercent;
float MPPercent;
void FullRecovery()
{
float RestoreMP = MyChar->MaxMP * MPPercent;
float RestoreHP = MyChar->MaxHP * HPPercent;
if(rec)
{
if(MyChar->Exists == 1)
{
if(MyChar->CurMP <= RestoreMP)
{
FullRecover();
}
if(MyChar->CurHP <= RestoreHP)
{
FullRecover();
}
}
}
}
Now for updating the address of the full recovery function you would just need to search a sequence of bytes in Ollydebug:
Code:
004A2291 |. 50 PUSH EAX ; /Arg2
004A2292 |. 8B4D 8C MOV ECX,DWORD PTR SS:[EBP-74] ; |
004A2295 |. 51 PUSH ECX ; |Arg1
004A2296 |. B9 A0AA5900 MOV ECX,TwelveSk.0059AAA0 ; |
004A229B |. E8 00FBF7FF CALL TwelveSk.00421DA0 ; \TwelveSk.00421DA0
004A22A0 |. 5F POP EDI ; 0012FD30
Just load the game into Olly, use "Search for sequence of bytes" and just search the first few lines of the function above:
Code:
PUSH EAX
MOV ECX,DWORD PTR SS:[EBP-74]
PUSH ECX
You need to just keep searching until you find a function that looks exactly like the function I posted above(obviously the address will differ however, this is the whole point of the search to find the new address).
The address you will be interested in here will obviously be the call:
Code:
CALL TwelveSk.00421DA0
If this were from the new game client, then 0x00421DA0 would be the new address. Just plug the new address into the __asm function I posted on the top of this thread and now you have a fully working FullRecovery option for your botting pleasure.
The way this function got started: I believe it was Seth_day that contacted me one day telling me of an option he had found that was located on a hidden menu in the game that had some "Full Recovery" option to reload HP/Chi. He asked me if I could find a way to use the function manually from anywhere within a bot. After about 10minutes of searching I came up with the function above.
Enjoy, hopefully some generous people will figure this out and release a public copy for everyone to enjoy. If not, I have found my old source so I may eventually release an update, but its just not my main concern right now.
Credits:
as always: Megabyte for a major support in getting me started with my bot ideas(the ollydebug config that allowed to actually use BP's was the headstart I needed"
Seth_day for tipping me off about the FullRecovery function existing in the game client.
Wazzapoo helped me on a good deal of C++ functions in my bot for a few things such as putting my AutoLooting/Loot Filter functions to work in the bot.
Sidenote: You can just plug this code into any .dll source and get it working. Just make a base .dll project with the .dll entry point. Begin a thread from the .dll main and call the code from within the thread. Use MSDN if you cannot figure out how to do that. There are also a couple of simple .dll projects posted by Megabyte and I believe I posted a small source as well. Use Microsoft visual studio to compile it and your good to go.
Also you obviously need to clean up my code a bit. Example: where I use MyChar->MaxHP, just replace this with whatever pointer you assign your characters maxhp address to or use ReadProcessMemory to read your chars maxhp from the games memory. My->MaxHP refers to the character struct I had in my bot to read characters information from the game client easily.