Code:
void FullRecover() { UINT_PTR adr = 0x004A5570; //Old address __asm { CALL adr } }
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(); } } } }
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
Code:
PUSH EAX MOV ECX,DWORD PTR SS:[EBP-74] PUSH ECX
The address you will be interested in here will obviously be the call:
Code:
CALL TwelveSk.00421DA0
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.