![]() |
|
A new itr effect - Printable Version +- Little Fighter Empire - Forums (https://lf-empire.de/forum) +-- Forum: Little Fighter 2 Zone (https://lf-empire.de/forum/forumdisplay.php?fid=7) +--- Forum: [2.0] Exe Editing (https://lf-empire.de/forum/forumdisplay.php?fid=43) +--- Thread: A new itr effect (/showthread.php?tid=3608) |
A new itr effect - Thomas - 09-13-2009 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 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 r2XXX=Destination Frame Number YYY=ID Number ZZZ ercentage of HPbut it do not work Where should I make change? Finally, Thank you to understand my english
RE: A new itr effect - Boop - 09-13-2009 LF2 is a 32 bit program, meaning it uses 32 bit registers. So the maximum value would be 4 294 967 296(2^32). However, that is the unsigned value (only includes positives). If it is signed, 1 bit is used to represent negatives. That makes the maximum value 2,147,483,648(2^31). The "i" in idiv stands for integer (signed value). Basically, you can either fix it by: a) Using div and not idiv (not sure what the actual command is , but I think it should be div).b) Using smaller numbers. I don't understand why you need the ID in the effect? Your post says nothing about affecting certain ID's. Anyway, I hope that answered your question. |