Here you go; adjusted:
Code: Select all
define( AdrestiaDamageMultiplierHook, address_of_your_cave ) // or allocate it
[ENABLE]
aobscanmodule( AdrestiaDamageMultiplier, ACOdyssey.exe, 66410F6E8E????????0F5BC9F30F59C80F57C00F2FC8 )
registersymbol( AdrestiaDamageMultiplier )
label( AdrestiaDamageMultiplier_o )
registersymbol( AdrestiaDamageMultiplier_o )
aobscanmodule( GetMetaAIVirtualObjectivePlayerEntity, ACOdyssey.exe, 48895C24??574883EC??E8????????488BD84885C074??488B10488BC8FF52??488BF8E8????????0FB748??66394F??72??0FB748??66394F??77??488B03488BCBFF90 )
registersymbol( GetMetaAIVirtualObjectivePlayerEntity )
label( s_dmg_mult_f )
registersymbol( s_dmg_mult_f )
label( back )
label( CheckEntity )
registersymbol( CheckEntity )
label( CheckEntity_null )
label( CheckEntity_exit )
label( GetEntity )
registersymbol( GetEntity )
AdrestiaDamageMultiplierHook:
AdrestiaDamageMultiplier_o:
readmem( AdrestiaDamageMultiplier, 9 )
push rax
push rcx
push rdx
call short CheckEntity
test al,al
je short @f
mov rax,s_dmg_mult_f
movss xmm0,[rax]
@@:
pop rdx
pop rcx
pop rax
jmp back
db CC CC CC CC
CheckEntity:
sub rsp,28
//mov rcx,r13 -- this is the EntityGroup of the target ship
mov rax,[r14+50]
test rax,rax
je short CheckEntity_null
mov rcx,[rax+8]
shl rcx,20
sar rcx,3F
and rcx,[rax] // this gets the EntityGroup of the ship firing
je short CheckEntity_null
call short GetEntity
test rax,rax
je short CheckEntity_exit
movzx ecx,byte ptr [rax+D8]
xor eax,eax
and cl,7
cmp cl,1
sete al
add rsp,28
ret
CheckEntity_null:
xor al,al
CheckEntity_exit:
add rsp,28
ret
db CC CC CC CC
GetEntity:
sub rsp,28
add rcx,1A0
call GetMetaAIVirtualObjectivePlayerEntity
mov rcx,[rax]
mov rax,[rcx+8]
shl rax,20
sar rax,3F
and rax,[rcx]
je short @f
cmp qword ptr [rax+18],00
jne short @f
xor eax,eax
@@:
add rsp,28
ret
db CC CC CC CC
s_dmg_mult_f:
dd (float)1.0
db DE AD C0 DE
AdrestiaDamageMultiplier:
jmp AdrestiaDamageMultiplierHook
db 90 90 90 90
back:
[DISABLE]
AdrestiaDamageMultiplier:
readmem( AdrestiaDamageMultiplier_o, 9 )
unregistersymbol( GetEntity )
unregistersymbol( CheckEntity )
unregistersymbol( s_dmg_mult_f )
unregistersymbol( GetMetaAIVirtualObjectivePlayerEntity )
unregistersymbol( AdrestiaDamageMultiplier_o )
unregistersymbol( AdrestiaDamageMultiplier )
Just give it a cave address up top, in the define, for
AdrestiaDamageMultiplierHook.