Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Health Regeneration

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Renard10177
Newbie cheater
Reputation: 0

Joined: 19 Jun 2013
Posts: 12

PostPosted: Sat Oct 05, 2013 5:57 pm    Post subject: Health Regeneration Reply with quote

I want to make a cheat that allows health to be gradually regenerated after the player takes no damage for 1 second, how do i do this?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 460

Joined: 09 May 2003
Posts: 25333
Location: The netherlands

PostPosted: Sat Oct 05, 2013 6:21 pm    Post subject: Reply with quote

You can use a lua script that launches a timer that checks every second if you lost health, and if not increase health

Or do an injection and call GetTickCount to determine the time

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Renard10177
Newbie cheater
Reputation: 0

Joined: 19 Jun 2013
Posts: 12

PostPosted: Sat Oct 05, 2013 6:40 pm    Post subject: Reply with quote

Dark Byte wrote:
You can use a lua script that launches a timer that checks every second if you lost health, and if not increase health

Or do an injection and call GetTickCount to determine the time

well what if i want to just make it gradually increase until it reaches a certain number? (i also dont know how to do very much in auto assemble and lua, and i am not completely fluent in the assembly code language)


Last edited by Renard10177 on Tue Oct 08, 2013 3:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 460

Joined: 09 May 2003
Posts: 25333
Location: The netherlands

PostPosted: Sat Oct 05, 2013 6:48 pm    Post subject: Reply with quote

easiest is a lua script then

Code:

function CheckHealth(t)
  local al=getAddressList()
  local memrec=al.getMemoryRecordByDescription("Health")
  if memrec~=nil then
    if tonumber(memrec.Value)<100 then
      memrec.Value=memrec.Value+1
    end
  end
end

t=createTimer(nil)
t.OnTimer=CheckHealth
t.Interval=1000 --every 1 second
t.Enabled=true


_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Oct 06, 2013 9:07 am    Post subject: Reply with quote

AA script example:

Code:
[ENABLE]
alloc(newmem,512)
label(mycode)
label(returnhere)
label(originalcode)
label(cont1)
label(cont2)

label(storeeax)
label(limits)
label(delta)
label(delay)
label(nodamage_counter)
registersymbol(nodamage_counter)

label(previous)
label(nodamage)

newmem:
//variables
storeeax:
dd 00
previous:  //previous health status
dd 00
delay:    //first delay
dd 00
nodamage_counter:
dd 00

delta:
dd 00

limits:
dd (float)0.35 //+0
dd (float)0.70 //+4
dd (float)1.00 //+8

//My Code
mycode:

// check pointer
mov [storeeax],eax
cmp [deadspace2.exe+01CAA040],0
je originalcode
mov eax,[deadspace2.exe+01CAA040]
mov eax,[eax+bc]
cmp ecx,eax
jne originalcode
//--------------------------------

// give us 1 second delay per step
inc [delay]
cmp [delay],(int)250
jb originalcode
mov [delay],(int)0
//--------------------------------

// our only condition - we can't get damage within 15 seconds
// (something like CoD style, halo style)
//
movss xmm0,[ecx+000000EC]        // get health
comiss xmm0,[previous]           // check with previous value
movss [previous],xmm0
jae nodamage
// we got damage, reset
mov [nodamage_counter],0         // reset timer
jmp originalcode
//
nodamage:
inc [nodamage_counter]
cmp [nodamage_counter],(int)15  // no damage for 15 seconds
jb originalcode                 // if below 15, we have to wait
dec [nodamage_counter]
//--------------------------------


// if we are between values (limits), enable health growing
//
mov eax,limits+00                  //set limit to 0.35
comiss xmm0,[limits+00]            //compare with 0.35
je originalcode
mov [delta],(float)0.02               //2.00% per second
jb cont1
//
mov eax,limits+04                  //set limit to 0.70
comiss xmm0,[limits+04]            //compare with 0.70
je originalcode
mov [delta],(float)0.0025               //0.25% per second
jb cont1
//
mov eax,limits+08                  //set limit to 1.00
comiss xmm0,[limits+08]            //compare with 1.00
jae originalcode
mov [delta],(float)0.005             //0.5% per second
jb cont1
//--------------------------------

// give a bit of health
cont1:
addss xmm0,[delta]
comiss xmm0,[eax]
jb short cont2
movss xmm0,[eax]
cont2:
movss [ecx+000000EC],xmm0
//--------------------------------

originalcode:
mov eax,[storeeax]
xorps xmm0,xmm0                     // orig code
comiss xmm0,[ecx+000000E8]    // orig code
jmp returnhere


//Hook
deadspace2.exe+B5552D:
jmp mycode
nop
nop
returnhere:

[DISABLE]
dealloc(newmem)
deadspace2.exe+B5552D:
comiss xmm0,[ecx+000000E8]
//Alt: db 0F 2F 81 E8 00 00 00



Above script was made for DeadSpace2. As you see there are three regions:
0 - 0.35 - if health is bigger than 0 and below 0.35 then regeneration is 2% per second, stops regenerating at 0.35, regeneration from 0 to 35% takes 17 seconds (from 17% to 35% would take 8.5 seconds)
0.35 - 0.70 - if above 0.35 and below 0.70, regeneration = 0.25% per second, stops regenerating at 0.70, time = 140s
0.70 - 1.00 - if above 0.70 and below 1.00, regeneration = 0.5% per second, stops regenerating at 1.00, time = 60s

Regeneration starts after 15 seconds after last damage.

Hack point at deadspace2.exe+B5552D is called about 250 times per second, of course for Isaac HP.
( I know it because I waited with "find out what ....." for about 5 minutes and I calculated average hits per second)





Of course you can use one big region 0.0 - 1.0, different wait time (1 second instead of 15), etc.

_________________
Back to top
View user's profile Send private message MSN Messenger
Renard10177
Newbie cheater
Reputation: 0

Joined: 19 Jun 2013
Posts: 12

PostPosted: Mon Oct 07, 2013 12:40 pm    Post subject: Reply with quote

mgr.inz.Player wrote:
AA script example:

Of course you can use one big region 0.0 - 1.0, different wait time (1 second instead of 15), etc.

Ahh, thanks mate!
now how do i add rep to you two?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites