← Back to DevelopmentAging & Mixing viewer.dll generatorProgramsClan filesInternet Information ServiceOllyDbg tutorialsMiscellaneousSkinsLinks / Files

weapon_holding_style

← Back to Miscellaneous
This explains how to configure the holding style of any weapon ingame.

1. Two handed when equiped in inventory
If you plan on making a 2 handed weapon, it needs to fill both slots when equiped. It's just a value to change in the item table.
If we take a look at the Jagged Axe (1 handed) and the Diamond Axe (2 handed) :

OllyDbg - Client side


OllyDbg - Client side



Quite easy :
* 04 if it's 1 handed
* 06 if it's 2 handed

2. Holding style
The hard part is to actually make the character hold the weapon correctly ingame.
And for that, the developers were funny enough to put this info outside the client. Yep, it's located inside the file char\tmABCD\M2Bip.inx.

Inside this file you have 7 different lists. Oh since it's alot of fun, some list are repeated more than 5 times in the file... Go figure.
The first value is the number of elements in the list. After you have the list.

A little note here about the list values. They represent the position of the item inside the item table. 0 being the first element.
If you want to pull out your item list with the positions, use this program (made for the occasion :P) with your client.
Also, one more thing, since each position is a byte, you can only edit the holding style of the first 256 elements of the item table.

1. Items on hand : claws, hand crossbows

Hexadecimal - Client side



2. One handed items : axes, maces, wands, spears, swords,

Hexadecimal - Client side



3. Two handed items (tip behind): axes, maces, swords

Hexadecimal - Client side



4. Two handed items (tip in front) : staves, spears

Hexadecimal - Client side



5. One handed items (throwing stance) : javelins

Hexadecimal - Client side



6. Two handed items (bow shooting stance) : bows

Hexadecimal - Client side



7. Two handed items (crossbow shooting stance) : bows

Hexadecimal - Client side



So if you want to change the holding style of a weapon, you just need to :
- Lookup its position
- Remove it from its original list (update the size)
- Add it to its new list (update the size)
- Done.

With this you should be able to actually add new weapons to your client.
- Relocate the item list
- Split the item list just before the defense items (if you add your new weapons at the end of the list the position will be too big)
- Add your weapons
- Move all the pointers to quest and special items to the correct location
- Should work :P .

Also, if you're adding weapons that are held with 1 hand in town, don't forget to check the paper about it and move/update this table too.

1 handed Diamond axe, 2 handed Jaggy... serious business x_o !

01.jpg

02.jpg

3. Gibberish
For those who can't get enough of reading gibberish, here's the code portion :

OllyDbg - Client Side

00417C34  |> /8B74BC 30                  MOV ESI,DWORD PTR SS:[EDI*4+ESP+30]
00417C38  |. |8B4424 28                  MOV EAX,DWORD PTR SS:[LOCAL.129]
00417C3C  |. |8BD6                       MOV EDX,ESI                                                ; Calculating the address
00417C3E  |. |6BD2 78                    IMUL EDX,EDX,78                                            ; Calculating the address
00417C41  |. |03D0                       ADD EDX,EAX                                                ; Calculating the address
00417C43  |. |8B82 B0010000              MOV EAX,DWORD PTR DS:[EDX+1B0]                             ; Number of items in the list
00417C49  |. |85C0                       TEST EAX,EAX                                               ; Check if empty
00417C4B  |. |0F84 82000000              JE 00417CD3                                                ; Skip if empty
00417C51  |. |8B4C24 24                  MOV ECX,DWORD PTR SS:[LOCAL.130]                           ; Code of the item to display
00417C55  |. |85C9                       TEST ECX,ECX                                               ; Check if empty
00417C57  |. |0F84 B0000000              JE 00417D0D                                                ; Skip if empty
00417C5D  |. |33C9                       XOR ECX,ECX                                                ; Emptying ECX
00417C5F  |. |85C0                       TEST EAX,EAX                                               ; Testing again if empty
00417C61  |. |0F8E 7C000000              JLE 00417CE3                                               ; Skip if empty
00417C67  |. |81C2 B4010000              ADD EDX,1B4                                                ; Calculating the address
00417C6D  |. |8D49 00                    LEA ECX,[ECX]                                              ; ECX was XORed -_-
00417C70  |> |0FB61A                     /MOVZX EBX,BYTE PTR DS:[EDX]                               ; Number in the list
00417C73  |. |8B6C24 24                  |MOV EBP,DWORD PTR SS:[LOCAL.130]                          ; Code of the item to display
00417C77  |. |69DB 14030000              |IMUL EBX,EBX,314                                          ; 314 is the space between each item
00417C7D  |. |3BAB E8295F00              |CMP EBP,DWORD PTR DS:[EBX+5F29E8]                         ; Compare with the item code in the item table
00417C83  |. |74 4A                      |JE SHORT 00417CCF                                         ; Report the item holding code if the item match
00417C85  |. |41                         |INC ECX
00417C86  |. |42                         |INC EDX
00417C87  |. |3BC8                       |CMP ECX,EAX
00417C89  |.^|7C E5                      \JL SHORT 00417C70
00417C8B  |. |8B6C24 18                  MOV EBP,DWORD PTR SS:[LOCAL.133]
00417C8F     |EB 52                      JMP SHORT 00417CE3
00417C91  |> |84C0                       TEST AL,AL
00417C93  |.^|0F84 E0FEFFFF              JE 00417B79
00417C99  |. |8B4424 10                  MOV EAX,DWORD PTR SS:[LOCAL.135]
00417C9D  |. |8B6C24 18                  MOV EBP,DWORD PTR SS:[LOCAL.133]
00417CA1  |. |895C84 30                  MOV DWORD PTR SS:[EAX*4+ESP+30],EBX
00417CA5  |. |40                         INC EAX
00417CA6  |. |83F8 20                    CMP EAX,20
00417CA9  |. |894424 10                  MOV DWORD PTR SS:[LOCAL.135],EAX
00417CAD  |.^|0F8D E5FEFFFF              JGE 00417B98
00417CB3  |.^|E9 C5FEFFFF                JMP 00417B7D
00417CB8  |> |895C94 30                  MOV DWORD PTR SS:[EDX*4+ESP+30],EBX
00417CBC  |. |42                         INC EDX
00417CBD  |. |83FA 20                    CMP EDX,20
00417CC0  |. |895424 10                  MOV DWORD PTR SS:[LOCAL.135],EDX
00417CC4  |.^|0F8D CEFEFFFF              JGE 00417B98
00417CCA  |.^|E9 AEFEFFFF                JMP 00417B7D
00417CCF  |> |8B6C24 18                  MOV EBP,DWORD PTR SS:[LOCAL.133]
00417CD3  |> |8B4424 14                  MOV EAX,DWORD PTR SS:[LOCAL.134]
00417CD7  |. |89B484 30010000            MOV DWORD PTR SS:[EAX*4+ESP+130],ESI
00417CDE  |. |40                         INC EAX
00417CDF  |. |894424 14                  MOV DWORD PTR SS:[LOCAL.134],EAX
00417CE3  |> |8B5424 10                  MOV EDX,DWORD PTR SS:[LOCAL.135]
00417CE7  |. |47                         INC EDI
00417CE8  |. |3BFA                       CMP EDI,EDX
00417CEA  |.^\0F8C 44FFFFFF              JL 00417C34