Sir, You Are Being Hunted
Posted: Tue Jun 13, 2017 9:36 am
I know there is a table for this already, but it's a basic table, and I wanted to write a scripted version that might survive an update. So far, I've got Vitality working fine, but for some odd reason, Health is being difficult.
I've found the value/location. That's easy. The same routine is used to futz with both the player and the enemies health. So the obvious thing is to find a value to compare against. I've done that as well, but it still doesn't work.
In the above image, [rdi+30] holds the current players health, [RDI+28] holds the maximum health (which the game moves into different xmm registers I've noticed). Also of note is that [rdi+30] is always the same, '1' for the enemies and '0.349999994' for the player. So I thought I would write the following code to differentiate between the player and the enemy:
But it doesn't work. I've tried a few different things, but for some odd reason, any compares I do just fail. If anyone can point me onto the path of salvation (or at least a working script), then I'd be a happy person.
Cheers.
I've found the value/location. That's easy. The same routine is used to futz with both the player and the enemies health. So the obvious thing is to find a value to compare against. I've done that as well, but it still doesn't work.
In the above image, [rdi+30] holds the current players health, [RDI+28] holds the maximum health (which the game moves into different xmm registers I've noticed). Also of note is that [rdi+30] is always the same, '1' for the enemies and '0.349999994' for the player. So I thought I would write the following code to differentiate between the player and the enemy:
Code: Select all
label(code)
label(return)
label(player)
newmem:
push rax
mov rax, [rdi+30]
cmp rax,(float)1
pop rax
jl player
code:
movss [rdi+34],xmm15
jmp return
player:
mov [rdi+14],(float)100
movss xmm15,[rdi+14]
jmp code
Cheers.