Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Help] How to resize items model in inventory?

Junior Spellweaver
Joined
Feb 18, 2011
Messages
108
Reaction score
41
Hi,

I want to change height and width of every item in the game to 1:1 (every item will ocupy 1 slot in inventory).

By changing the values of Height and Width in item.bmd the item ocupies only 1 slot but the 3d model of the item remains the same. I need to resize the model too to fit in 1 slot.

Does anyone know if there is a client file with the size (height/width) of items models or this is hard-coded in the .exe?

Thanks in advance.
 
Novice C++
Joined
Feb 14, 2011
Messages
576
Reaction score
230
Hi,

I want to change height and width of every item in the game to 1:1 (every item will ocupy 1 slot in inventory).

By changing the values of Height and Width in item.bmd the item ocupies only 1 slot but the 3d model of the item remains the same. I need to resize the model too to fit in 1 slot.

Does anyone know if there is a client file with the size (height/width) of items models or this is hard-coded in the .exe?

Thanks in advance.

You can use Milkshape to change the size of items, if you have ItemTRSData.bmd you should look there too.
 
Upvote 0
Junior Spellweaver
Joined
Feb 18, 2011
Messages
108
Reaction score
41
You can use Milkshape to change the size of items, if you have ItemTRSData.bmd you should look there too.

Hi, I forgot to mention I'm doing it in a Season 6 client. I couldn't find any file named "ItemTRSData.bmd". May you explain what is this Milkshape?

Thanks.
 
Upvote 0
Novice C++
Joined
Feb 14, 2011
Messages
576
Reaction score
230
Hi, I forgot to mention I'm doing it in a Season 6 client. I couldn't find any file named "ItemTRSData.bmd". May you explain what is this Milkshape?

Thanks.

Use Pentium tools to convert BMD -> SMD, use to edit/resize the SMD, convert back -> and done
 
Upvote 0
Junior Spellweaver
Joined
Feb 18, 2011
Messages
108
Reaction score
41
Use Pentium tools to convert BMD -> SMD, use to edit/resize the SMD, convert back -> and done

Hmm I see... But you know I only want to edit the size of the 3d model in inventory right?

Editing the item's BMD to make it smaller will change the model in the game too, isn't it?

Or there is a BMD of the item 3d model in inventory and another BMD of the 3d model displayed in the character?
 
Upvote 0
Joined
Oct 29, 2007
Messages
1,267
Reaction score
1,284
Trying to summon @Kiosani again ._.

English:
Well, if you make ask to me if this it's possible... it's possible, only that in the first place you did not give us details about the version of your main.exe (If it's bigger than Season 6.3) I cannot help you, since I do not work with main.exe that are packaged (or not completely unpacked). If your version of your main.exe is less than Season 6.3, I can only think of 1 way to do it... rewriting a function, the problem is that you would have to pause all the objects again, and if you use a loop: "for" to make this... surely you are going to make of the loading of the main.exe (in the: Loading Stage) be unlimited. so in the end it is something a bit tedious to do. but if it is possible to do it.

Spanish:
Bueno de que es posible... es posible, solo que en primer lugar no nos diste detalles sobre la versión de tu main.exe (Si es mayor que Season 6.3) no puedo ayudarte, ya que no trabajo con main.exe que están empaquetados (o bien no completamente desempaquetados). si la versión de tu main.exe es menor que Season 6.3, solo se me ocurre 1 forma de hacerlo... re-escribiendo una función, el problema es que habría que volver a parsear todos los Objetos, y si usas un bucle: "for" para eso... seguramente vas a hacer interminable la carga del main.exe (En el: Loading Stage). asique en definitiva es algo un tanto tedioso de hacer. pero si es posible hacerlo.
 
Upvote 0
Joined
Nov 4, 2012
Messages
928
Reaction score
544
pDrawItemModel, hook all calls and change Width and Height

#define pDrawItemModel ((void(__cdecl*)(float PosX,float PosY,float Width,float Height,int ItemID,int Level,int Excellent,int Ancient,int Floating)) 0x5D2280) // Floating related to size

Ps. It is for main 1.03.42 (You need to download as 1.03.43 main from webzen ftp to make a research)

Edit:

1.04D Main offset: sub_51EEF0
 
Upvote 0
Junior Spellweaver
Joined
Feb 18, 2011
Messages
108
Reaction score
41
English:
Well, if you make ask to me if this it's possible... it's possible, only that in the first place you did not give us details about the version of your main.exe (If it's bigger than Season 6.3) I cannot help you, since I do not work with main.exe that are packaged (or not completely unpacked). If your version of your main.exe is less than Season 6.3, I can only think of 1 way to do it... rewriting a function, the problem is that you would have to pause all the objects again, and if you use a loop: "for" to make this... surely you are going to make of the loading of the main.exe (in the: Loading Stage) be unlimited. so in the end it is something a bit tedious to do. but if it is possible to do it.

Spanish:
Bueno de que es posible... es posible, solo que en primer lugar no nos diste detalles sobre la versión de tu main.exe (Si es mayor que Season 6.3) no puedo ayudarte, ya que no trabajo con main.exe que están empaquetados (o bien no completamente desempaquetados). si la versión de tu main.exe es menor que Season 6.3, solo se me ocurre 1 forma de hacerlo... re-escribiendo una función, el problema es que habría que volver a parsear todos los Objetos, y si usas un bucle: "for" para eso... seguramente vas a hacer interminable la carga del main.exe (En el: Loading Stage). asique en definitiva es algo un tanto tedioso de hacer. pero si es posible hacerlo.

The version is 1.04E. The executable is the original one but it does not seem to be packed at all. The PE sections seems right as the IAT.

I know this is possible to do. I'm asking for some light in which direction I can go so I can save some time analysing the .exe.



pDrawItemModel, hook all calls and change Width and Height

#define pDrawItemModel ((void(__cdecl*)(float PosX,float PosY,float Width,float Height,int ItemID,int Level,int Excellent,int Ancient,int Floating)) 0x5D2280) // Floating related to size

Ps. It is for main 1.03.42 (You need to download as 1.03.43 main from webzen ftp to make a research)

Edit:

1.04D Main offset: sub_51EEF0

Hum, so the size (height and width) of the 3d models showed in the inventory is hard-coded in the .exe then? I thought it could be inside some binary file (those BMD, etc).
 
Upvote 0
(づ。◕‿‿◕。)
Loyal Member
Joined
Jun 23, 2014
Messages
1,853
Reaction score
422
Hum, so the size (height and width) of the 3d models showed in the inventory is hard-coded in the .exe then? I thought it could be inside some binary file (those BMD, etc).
It is in the itemTRSdata from ex700+ versions and above, in s6 and lower is hardcoded in main.

you can take the most of the offsets from zteam season 6 source (main 1.04D), to migrate them to 1.04E you have to substract 0x150 from offset 0x0068xxx and -0x180 from offset 0x009xxxx. That way you wont have to research everything from scratch.
 
Upvote 0
Junior Spellweaver
Joined
Feb 18, 2011
Messages
108
Reaction score
41
It is in the itemTRSdata from ex700+ versions and above, in s6 and lower is hardcoded in main.

you can take the most of the offsets from zteam season 6 source (main 1.04D), to migrate them to 1.04E you have to substract 0x150 from offset 0x0068xxx and -0x180 from offset 0x009xxxx. That way you wont have to research everything from scratch.

This zteam source have a patch to this variables I'm looking for? Also, may you send me the "official" link of this source you are talking?
 
Upvote 0
Skilled Illusionist
Joined
Jun 22, 2017
Messages
363
Reaction score
557
UHhpCAZ - [Help] How to resize items model in inventory? - RaGEZONE Forums


try this: (Offset main 1.04.03)

Code:
BOOL GetModelScale(int ItemIndex, float * Scale)
{
    switch (ItemIndex)
    {
    case 0x14B5:
  *Scale = 0.0032f;
  return TRUE;
    case ITEM2(7, 150):
  *Scale = 0.0155f;
  return TRUE;
    }

    return FALSE;
}

__declspec(naked) void SetModelScale()
{
    static DWORD Address1 = 0x005CE8ED;
    static DWORD Address2 = 0x005CD42F;

    _asm
    {
  Lea Edx, Dword Ptr Ss:[Ebp-0x2C]
  Push Edx
  Mov Ecx, Dword Ptr Ss : [Ebp + 0x8]
  Push Ecx
  Call GetModelScale  
  Add Esp, 0x8
  Test Eax, Eax
  Je EXIT
  Jmp Address1
  EXIT:
  Jmp Address2
    }
}

SetCompleteHook(0xE9, 0x005CD41B, &SetModelScale);

PHP:
patch-ggp.muonline.webzen.net/1.04.03/up_list.zip
 

Attachments

You must be registered for see attachments list
Upvote 0
Junior Spellweaver
Joined
Feb 18, 2011
Messages
108
Reaction score
41
UHhpCAZ - [Help] How to resize items model in inventory? - RaGEZONE Forums


try this: (Offset main 1.04.03)

Code:
BOOL GetModelScale(int ItemIndex, float * Scale)
{
    switch (ItemIndex)
    {
    case 0x14B5:
  *Scale = 0.0032f;
  return TRUE;
    case ITEM2(7, 150):
  *Scale = 0.0155f;
  return TRUE;
    }

    return FALSE;
}

__declspec(naked) void SetModelScale()
{
    static DWORD Address1 = 0x005CE8ED;
    static DWORD Address2 = 0x005CD42F;

    _asm
    {
  Lea Edx, Dword Ptr Ss:[Ebp-0x2C]
  Push Edx
  Mov Ecx, Dword Ptr Ss : [Ebp + 0x8]
  Push Ecx
  Call GetModelScale  
  Add Esp, 0x8
  Test Eax, Eax
  Je EXIT
  Jmp Address1
  EXIT:
  Jmp Address2
    }
}

SetCompleteHook(0xE9, 0x005CD41B, &SetModelScale);

PHP:
patch-ggp.muonline.webzen.net/1.04.03/up_list.zip

Thank you very much sir.
 

Attachments

You must be registered for see attachments list
Upvote 0
Skilled Illusionist
Joined
Jun 22, 2017
Messages
363
Reaction score
557
new fixes , now can work with all items and able to fix item position

Code:
BOOL GetModelScale(int ItemIndex, float * Scale, Vec3D * VecPos)
{
    switch (ItemIndex)
    {
    case ITEM2(7, 150):
  (*Scale) = 0.0055f;
  return TRUE;
    case ITEM2(14, 351):
  VecPos->Y += 0.1f;
  break; //return FALSE
    }

    return FALSE;
}

__declspec(naked) void SetModelScale()
{
    static DWORD Address1 = 0x005CE8ED;
    static DWORD Address2 = 0x005CD2DE;

    _asm
    {
  Lea Eax, Dword Ptr Ss:[Ebp-0x4C]
  Push Eax
  Lea Ecx, Dword Ptr Ss:[Ebp-0x2C]
  Push Ecx
  Mov Edx, Dword Ptr Ss : [Ebp + 0x8]
  Push Edx
  Call GetModelScale  
  Add Esp, 0xC
  Test Eax, Eax
  Je EXIT
  Jmp Address1
  EXIT:
  CMP DWORD PTR SS : [EBP + 0x8], 0x1293
  Jmp Address2
    }
}

SetCompleteHook(0xE9, 0x005CD2D7, &SetModelScale);

b0bZ9eo - [Help] How to resize items model in inventory? - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Last edited:
Upvote 0
Junior Spellweaver
Joined
Feb 18, 2011
Messages
108
Reaction score
41
new fixes , now can work with all items and able to fix item position

Code:
BOOL GetModelScale(int ItemIndex, float * Scale, Vec3D * VecPos)
{
    switch (ItemIndex)
    {
    case ITEM2(7, 150):
  (*Scale) = 0.0055f;
  return TRUE;
    case ITEM2(14, 351):
  VecPos->Y = VecPos->Y + 0.1f;
  break; //return FALSE
    }

    return FALSE;
}

__declspec(naked) void SetModelScale()
{
    static DWORD Address1 = 0x005CE8ED;
    static DWORD Address2 = 0x005CD2DE;

    _asm
    {
  Lea Eax, Dword Ptr Ss:[Ebp-0x4C]
  Push Eax
  Lea Ecx, Dword Ptr Ss:[Ebp-0x2C]
  Push Ecx
  Mov Edx, Dword Ptr Ss : [Ebp + 0x8]
  Push Edx
  Call GetModelScale  
  Add Esp, 0xC
  Test Eax, Eax
  Je EXIT
  Jmp Address1
  EXIT:
  CMP DWORD PTR SS : [EBP + 0x8], 0x1293
  Jmp Address2
    }
}

SetCompleteHook(0xE9, 0x005CD2D7, &SetModelScale);

b0bZ9eo - [Help] How to resize items model in inventory? - RaGEZONE Forums

myheart one question: could you share the "ITEM2" macro? I thought the item id used in this function would be (cat * 512 + type) but it isn't.

PS: I think a safer address to hook is this: 0x5CE8ED. Probably will have the same effect as yours but this is the landing address of the 'nested if' above it.
 

Attachments

You must be registered for see attachments list
Upvote 0
Joined
Nov 4, 2012
Messages
928
Reaction score
544
UHhpCAZ - [Help] How to resize items model in inventory? - RaGEZONE Forums


try this: (Offset main 1.04.03)

Code:
BOOL GetModelScale(int ItemIndex, float * Scale)
{
    switch (ItemIndex)
    {
    case 0x14B5:
  *Scale = 0.0032f;
  return TRUE;
    case ITEM2(7, 150):
  *Scale = 0.0155f;
  return TRUE;
    }

    return FALSE;
}

__declspec(naked) void SetModelScale()
{
    static DWORD Address1 = 0x005CE8ED;
    static DWORD Address2 = 0x005CD42F;

    _asm
    {
  Lea Edx, Dword Ptr Ss:[Ebp-0x2C]
  Push Edx
  Mov Ecx, Dword Ptr Ss : [Ebp + 0x8]
  Push Ecx
  Call GetModelScale  
  Add Esp, 0x8
  Test Eax, Eax
  Je EXIT
  Jmp Address1
  EXIT:
  Jmp Address2
    }
}

SetCompleteHook(0xE9, 0x005CD41B, &SetModelScale);

PHP:
patch-ggp.muonline.webzen.net/1.04.03/up_list.zip

will not work for other parts than inventory, again i suggest you to see a function that i have posted, duo all calls to inventory model size is remated with this function, like in cashshop for example.
 

Attachments

You must be registered for see attachments list
Upvote 0
Skilled Illusionist
Joined
Jun 22, 2017
Messages
363
Reaction score
557
will not work for other parts than inventory, again i suggest you to see a function that i have posted, duo all calls to inventory model size is remated with this function, like in cashshop for example.
you didn't even test it?it's a part of the pDrawItemModel.
 
Upvote 0
Back
Top