Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weapon's Broken Pieces of ID
#1
If you want to creat a new weapon and add it into LF2,
yuo may think about problem, it has no pieces after it broke.
Now this problem could be solved.

There are three parts that relate with the broken pieces of each id.
If you want to copy the id or creat a new one,you have to change these parts.


First part

004228E3 . 8B81 F4060000 mov eax,dword ptr ds:[ecx+6F4]
004228E9 . 83F8 65 cmp eax,65
004228EC . 74 07 je short lf2-t.004228F5
004228EE . 3D DA000000 cmp eax,0DA
004228F3 . 75 09 jnz short lf2-t.004228FE
004228F5 > BE 07000000 mov esi,7
004228FA . 897424 14 mov dword ptr ss:[esp+14],esi
004228FE 83F8 64 cmp eax,64
00422901 74 0E je short lf2-t.00422911
00422903 . 3D D5000000 cmp eax,0D5
00422908 . 74 07 je short lf2-t.00422911
0042290A . 3D D9000000 cmp eax,0D9
0042290F . 75 09 jnz short lf2-t.0042291A
00422911 > BE 05000000 mov esi,5
00422916 . 897424 14 mov dword ptr ss:[esp+14],esi
0042291A > 3D C9000000 cmp eax,0C9
0042291F . 75 09 jnz short lf2-t.0042292A
00422921 . BE 03000000 mov esi,3
00422926 . 897424 14 mov dword ptr ss:[esp+14],esi
0042292A > 3D 96000000 cmp eax,96
0042292F . 75 09 jnz short lf2-t.0042293A
00422931 . BE 0D000000 mov esi,0D
00422936 . 897424 14 mov dword ptr ss:[esp+14],esi
0042293A > 3D 97000000 cmp eax,97
0042293F . 75 09 jnz short lf2-t.0042294A
00422941 . BE 0F000000 mov esi,0F
00422946 . 897424 14 mov dword ptr ss:[esp+14],esi
0042294A > 83F8 78 cmp eax,78
0042294D . 74 05 je short lf2-t.00422954
0042294F . 83F8 7C cmp eax,7C
00422952 . 75 09 jnz short lf2-t.0042295D
00422954 > BE 03000000 mov esi,3
00422959 . 897424 14 mov dword ptr ss:[esp+14],esi
0042295D > 83F8 79 cmp eax,79
00422960 . 75 09 jnz short lf2-t.0042296B
00422962 . BE 04000000 mov esi,4
00422967 . 897424 14 mov dword ptr ss:[esp+14],esi
0042296B > 83F8 7A cmp eax,7A
0042296E . 74 05 je short lf2-t.00422975
00422970 . 83F8 7B cmp eax,7B
00422973 . 75 09 jnz short lf2-t.0042297E
00422975 > BE 09000000 mov esi,9
0042297A . 897424 14 mov dword ptr ss:[esp+14],esi
0042297E > 8B81 AC000000 mov eax,dword ptr ds:[ecx+AC]


Second part

00422AD9 . 8B82 F4060000 mov eax,dword ptr ds:[edx+6F4]
00422ADF . 3D 96000000 cmp eax,96
00422AE4 . 74 0E je short lf2-t.00422AF4
00422AE6 . 3D 97000000 cmp eax,97
00422AEB . 74 07 je short lf2-t.00422AF4
00422AED . 3D D5000000 cmp eax,0D5
00422AF2 . 75 29 jnz short lf2-t.00422B1D
00422AF4 > 6A 14 push 14
00422AF6 . E8 4572FFFF call lf2-t.00419D40
00422AFB . 99 cdq
00422AFC . 2BC2 sub eax,edx
00422AFE . 83C4 04 add esp,4
00422B01 . D1F8 sar eax,1
00422B03 . F7D8 neg eax
00422B05 . 894424 24 mov dword ptr ss:[esp+24],eax
00422B09 . 8B84B3 94010000 mov eax,dword ptr ds:[ebx+esi*4+194]
00422B10 . DB4424 24 fild dword ptr ss:[esp+24]
00422B14 . DC25 30324400 fsub qword ptr ds:[443230]
00422B1A . DD58 48 fstp qword ptr ds:[eax+48]
00422B1D > 8B8CBB 94010000 mov ecx,dword ptr ds:[ebx+edi*4+194]
00422B24 . 8B91 68030000 mov edx,dword ptr ds:[ecx+368]
00422B2A . 8B82 F4060000 mov eax,dword ptr ds:[edx+6F4]
00422B30 . E9 8BF90100 jmp lf2-t.004424C0
00422B35 > 3D C9000000 cmp eax,0C9
00422B3A . 74 2C je short lf2-t.00422B68
00422B3C . 83F8 65 cmp eax,65
00422B3F . 74 27 je short lf2-t.00422B68
00422B41 . 83F8 78 cmp eax,78
00422B44 . 74 22 je short lf2-t.00422B68
00422B46 . 83F8 79 cmp eax,79
00422B49 . 74 1D je short lf2-t.00422B68
00422B4B . 83F8 7A cmp eax,7A
00422B4E . 74 18 je short lf2-t.00422B68
00422B50 . 83F8 7B cmp eax,7B
00422B53 . 74 13 je short lf2-t.00422B68
00422B55 . 83F8 7C cmp eax,7C
00422B58 . 74 0E je short lf2-t.00422B68
00422B5A . 3D D9000000 cmp eax,0D9
00422B5F . 74 07 je short lf2-t.00422B68
00422B61 . 3D DA000000 cmp eax,0DA
00422B66 . 75 29 jnz short lf2-t.00422B91
00422B68 > 6A 08 push 8


Third part

00422BB3 |. 8B94BB 94010000 ||mov edx,dword ptr ds:[ebx+edi*4+194]
00422BBA |. 8B82 68030000 ||mov eax,dword ptr ds:[edx+368]
00422BC0 |. 81B8 F4060000 96000000 ||cmp dword ptr ds:[eax+6F4],96
00422BCA |. 75 34 ||jnz short lf2.00422C00
00422BCC |. 8B4424 10 ||mov eax,dword ptr ss:[esp+10]
   .         .                 . 
   .         .                 . 
   .         .                 . 
   .         .                 . 
   .         .                 . 
   .         .                 . 
00422F54 |> \8B8CBB 94010000 ||mov ecx,dword ptr ds:[ebx+edi*4+194]
00422F5B |. 8B91 68030000 ||mov edx,dword ptr ds:[ecx+368]
00422F61 |. 8B82 F4060000 ||mov eax,dword ptr ds:[edx+6F4]
00422F67 |. 3D D9000000 ||cmp eax,0D9
00422F6C |. 74 07 ||je short lf2.00422F75
00422F6E |. 3D DA000000 ||cmp eax,0DA
00422F73 |. 75 19 ||jnz short lf2.00422F8E
00422F75 |> 6A 04 ||push 4
00422F77 |. E8 C46DFFFF ||call lf2.00419D40
00422F7C |. 8B8CB3 94010000 ||mov ecx,dword ptr ds:[ebx+esi*4+194]
00422F83 |. 83C4 04 ||add esp,4
00422F86 |. 05 AE000000 ||add eax,0AE
00422F8B |. 8941 70 ||mov dword ptr ds:[ecx+70],eax
00422F8E |> 8B4424 10 ||mov eax,dword ptr ss:[esp+10]
00422F92 |. 8B4C24 14 ||mov ecx,dword ptr ss:[esp+14]
00422F96 |. 40 ||inc eax
00422F97 |. 3BC1 ||cmp eax,ecx
00422F99 |. 894424 10 ||mov dword ptr ss:[esp+10],eax
00422F9D |.^ 0F8C 07FAFFFF |\jl lf2.004229AA

Third part settles each id and it's pieces.
The red code is the weapon's id.
I created a new weapon id and it's own broken pieces.
You can consult it to copy or creat a new id and broke pieces by yourself.

I use id 100 (weapon0) to make procedure detour.

First part
004228FA . 897424 14 mov dword ptr ss:[esp+14],esi
004228FE E9 9DFB0100 jmp lf2-t.004424A0
00422903 . 3D D5000000 cmp eax,0D5
00422908 . 74 07 je short lf2-t.00422911

Second part
00422B2A . 8B82 F4060000 mov eax,dword ptr ds:[edx+6F4]
00422B30 . E9 8BF90100 jmp lf2-t.004424C0
00422B35 > 3D C9000000 cmp eax,0C9
00422B3A . 74 2C je short lf2-t.00422B68

Third part
00422C00 > \8B84BB 94010000 mov eax,dword ptr ds:[ebx+edi*4+194]
00422C07 . 8B88 68030000 mov ecx,dword ptr ds:[eax+368]
00422C0D . E9 EEF80100 jmp lf2-t.00442500
00422C12 90 nop
00422C13 90 nop
00422C14 . 75 37 jnz short lf2-t.00422C4D
00422C16 > 8B4424 10 mov eax,dword ptr ss:[esp+10]
00422C1A . 6A 04 push 4
00422C1C . 83F8 02 cmp eax,2


Detour of First part
004424A0 83F8 64 cmp eax,64
004424A3 ^ 0F84 6804FEFF je lf2-t.00422911
004424A9 3D 82000000 cmp eax,82
004424AE ^ 0F84 5D04FEFF je lf2-t.00422911
004424B4 ^ E9 4A04FEFF jmp lf2-t.00422903

Detour of Second part
004424C0 > 83F8 64 cmp eax,64
004424C3 .^ 0F84 9F06FEFF je lf2-t.00422B68
004424C9 3D 82000000 cmp eax,82
004424CE .^ 0F84 9406FEFF je lf2-t.00422B68
004424D4 .^ E9 5C06FEFF jmp lf2-t.00422B35

Detour of Third part
00442500 > \83B9 F4060000 64 cmp dword ptr ds:[ecx+6F4],64
00442507 .^ 0F84 0907FEFF je lf2-t.00422C16
0044250D . 81B9 F4060000 82000000 cmp dword ptr ds:[ecx+6F4],82
00442517 ^ 0F85 3007FEFF jnz lf2-t.00422C4D
0044251D 8B4424 10 mov eax,dword ptr ss:[esp+10]
00442521 6A 04 push 4
00442523 83F8 02 cmp eax,2
00442526 7D 20 jge short lf2-t.00442548
00442528 90 nop
00442529 90 nop
0044252A 90 nop
0044252B 90 nop
0044252C E8 0F78FDFF call lf2-t.00419D40
00442531 8B94B3 94010000 mov edx,dword ptr ds:[ebx+esi*4+194]
00442538 83C4 04 add esp,4
0044253B 05 B4000000 add eax,0B4
00442540 8942 70 mov dword ptr ds:[edx+70],eax
00442543 ^ E9 0507FEFF jmp lf2-t.00422C4D
00442548 E8 F377FDFF call lf2-t.00419D40
0044254D 8B8CB3 94010000 mov ecx,dword ptr ds:[ebx+esi*4+194]
00442554 83C4 04 add esp,4
00442557 05 B8000000 add eax,0B8
0044255C 8941 70 mov dword ptr ds:[ecx+70],eax
0044255F ^ E9 E906FEFF jmp lf2-t.00422C4D

The new id I creat is 130(82 in Hex).
After it broke, it's pieces is frame 180(0B4) and frame 184(0B8) in broken_weapon.dat


If you only want to copy the id, just replace the code at 00442517 and 0044251D
with
00442517  je lf2-t.00422C16
0044251D  jmp 00422C4D
And you don't have to write anything after line 0044251D
Reply
Thanks given by:
#2
what a crazy guy are you? this is awesome!!! congrats, thanks, whatever. SUPER!!!
[Image: random.php?pic=random]
www.lf-empire.de
Once I had a fortune, it said: "Leave now. Life is short. Time is luck"
Don't dream your life, live your dream!
Reply
Thanks given by:
#3
Now I understand why I couldn't do it :D. The code was split up in to many places. Great job :).
[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)