09-13-2009, 02:53 PM
First, I'm sorry for my title
I could not think another better title
because my english is very poor
I want to bring a enemy to specified frame when the enemy is lower than a specified HP
I have write this code
which
XXX=Destination Frame Number
YYY=ID Number
ZZZercentage of HP
but it do not work
Where should I make change?
Finally, Thank you to understand my english
I could not think another better title
because my english is very poor
I want to bring a enemy to specified frame when the enemy is lower than a specified HP
I have write this code
Code:
sub eax,2000000000 ; take off the '2' in front
mov ebx,1000
mov edx,0
idiv ebx
xor ebx,ebx
mov ebx,eax
xor eax,eax
mov eax,edx
xor edx,edx ; separate number #2XXXYYYZZZ into #XXXYYY & #ZZZ. #XXXYYY is stored in ebx, #ZZZ is stored in eax, EDX is cleared.
push ebx
push eax
mov ecx,dword ptr ds:[esi+edi*4+194h]
mov edx,dword ptr ds:[ecx+368h]
mov edx,dword ptr ds:[edx+304h] ;MaxHP
mov eax,dword ptr ds:[eax+2FCh] ;RedHP
imul ebx,eax,100
xor eax,eax
mov eax,ebx
idiv edx
mov ebx,eax
xor eax,eax
pop eax
cmp ebx,eax
jge r2
xor eax,eax
xor ebx,ebx
xor ecx,ecx
xor edx,edx
pop ebx
mov eax,ebx
xor ebx,ebx
mov ebx,1000
mov edx,0
idiv ebx
xor ebx,ebx
mov ebx,eax
xor eax,eax
mov eax,edx
xor edx,edx
mov ecx,dword ptr ds:[esi+edi*4+194h]
mov edx,dword ptr ds:[ecx+368h]
cmp dword ptr ds:[edx+6F4h],eax
jnz r2
xor eax,eax
mov eax,ebx
mov ecx,dword ptr ds:[esi+edi*4+194h]
mov dword ptr ds:[ecx+70h],eax
jmp r2
XXX=Destination Frame Number
YYY=ID Number
ZZZercentage of HP
but it do not work
Where should I make change?
Finally, Thank you to understand my english
Sorry for my poor english.
I will improve it.
Please try to understand my english and correct me if I use it wrong.
Thankyou
I will improve it.
Please try to understand my english and correct me if I use it wrong.
Thankyou