Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A new itr effect
#1
? 
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 r2
which
XXX=Destination Frame Number
YYY=ID Number
ZZZ=Percentage of HP
but it do not work

Where should I make change?

Finally, Thank you to understand my english:D
Sorry for my poor english.
I will improve it.:D
Please try to understand my english and correct me if I use it wrong.
Thankyou
Reply
Thanks given by:
#2
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 :p, 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.
[Image: doty7Xn.gif]

10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.


Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)