Guía: ItemDrop Name (Function Decompiled) - Source Mu - Mu Server Files
 

Noticias:

SMF - Just Installed!

Menú principal

Guía: ItemDrop Name (Function Decompiled)

Publicado por Dakosmu, Mar 19, 2026, 05:39 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Dakosmu

Guía: ItemDrop Name (Function Decompiled)

Hola, ¡hoy quiero compartir un pequeño código con ustedes! Este código sirve para mostrar el nombre de los objetos que caen de los monstruos o que el jugador lanza al suelo.

¡¡¡CUIDADO!!! ¡ESTÁ SIMPLEMENTE DESCOMPILADO! Lo publico aquí para aquellos que sean capaces de usarlo o editarlo.

Versión: 1.04e

ACTUALIZACIÓN: Con este código puedes cambiar el COLOR para todos los objetos que caen: joyas, zen, ítems con nivel, ítems excelentes... y más. Para más detalles, solo revisa el código. Programar con MU es divertido.



Paso 1: Cargar la función en Main.cpp

Agrega el siguiente Hook en tu Main.cpp:

SetCompleteHook(0xE9, 0x005C6980, &DrawBackgroundItem);
Paso 2: Implementación de la función (.CPP)

void CharView::DrawBackgroundItem(int a1, int a2, int a3, int a4, int a5, signed int a6, char a7) { void *v7; // eax@1

HGDIOBJ blue; // ST18_4@2

HGDIOBJ v9; // ST18_4@3

unsigned __int8 green; // ST14_1@24

unsigned __int8 red; // ST10_1@24

unsigned __int8 v12; // ST0C_1@24

void *v13; // eax@24

void *v14; // eax@27

char *v15; // ST04_4@29

float v16; // ST00_4@29

void *v17; // eax@29

int v18; // ST04_4@30

int v19; // ST00_4@30

void *v20; // eax@30

void *v21; // eax@31

GLfloat params; // [sp+34h] [bp-10h]@21

float v24; // [sp+38h] [bp-Ch]@21

float v25; // [sp+3Ch] [bp-8h]@21

float v26; // [sp+40h] [bp-4h]@21

v7 = pTextThis();   
pSetTextColor(v7, 0xFFu, 0xFFu, 0xFFu, 0xFFu);   
pTextThis();   
pSetBackgroundTextColor(pTextThis(), 0, 0, 0,-1);   

if (*(DWORD *)(a1 + 844) == 1)   
{     
    blue = pFontBold;   
    pTextThis();   
    pSetFont(pTextThis(),(int)blue);   
}   
else   
{     
    //v9 = ()pFontNormal();   
    pTextThis();   
    //pSetFont(v9);   
}   

switch (*(DWORD*)(a1 + 840))   
{   
    case 0:     
        glColor3f(1.0, 1.0, 1.0);     
        break;   
    case 1:     
        glColor3f(1.0, 0.80000001, 0.1);     
        break;   
    case 2:     
        glColor3f(0.89999998, 0.52999997, 0.13);     
        break;   
    case 3:     
        glColor3f(0.69999999, 0.69999999, 0.69999999);     
        break;   
    case 4:     
        glColor3f(1.0, 0.30000001, 0.30000001);     
        break;   
    case 5:     
        glColor3f(0.30000001, 1.0, 0.30000001);     
        break;   
    case 6:     
        glColor3f(0.30000001, 0.30000001, 1.0);     
        break;   
    case 7:     
        glColor3f(1.0, 0.30000001, 1.0);     
        break;   
    case 8:     
        glColor3f(0.69999999, 0.40000001, 1.0);     
        break;   
    case 9:     
        glColor3f(0.60000002, 0.40000001, 1.0);     
        break;   
    case 0xA:     
        glColor3f(1.0, 0.1, 1.0);     
        break;   
    case 0xB:     
        glColor3f(0.1, 1.0, 0.5);     
        break;   
    case 0xC:     
        glColor3f(0.40000001, 0.69999999, 1.0);     
        break;   
    case 0xD:     
        glColor3f(0.89999998, 0.89999998, 0.89999998);     
        break;   
    case 0xE:     
        glColor3f(1.0, 0.5, 0.2);     
        break;   
    default:     
        glColor3f(1.0, 1.0, 1.0);     
        break;   
}   

params = 1.0;   
v24 = 1.0;   
v25 = 1.0;   
v26 = 0.0;   

if (params < 0.8999999761581421 || v24 < 0.8999999761581421 || v25 < 0.8999999761581421)
{     
    green = (signed int)(v25 * 255.0);     
    red = (signed int)(v24 * 255.0);     
    v12 = (signed int)(params * 255.0);     
    v13 = pTextThis();     
    pSetTextColor(pTextThis(),(int)v13, v12, red, green);   
}   

if (a6 % 4 == 1 || a6 % 4 == 2)   
{     
    glColor3f(1.0, 1.0, 1.0);     
    v14 = pTextThis();     
    pSetTextColor(pTextThis(),(int)v14, 0, 0xFFu, 0);     
    pTextThis();     
    pSetBackgroundTextColor(pTextThis(),60, 60, -56, -1);   
}   

if (a7)   
{    //Alt key     
    v18 = *(WORD *)(a3 + 42) - 15;     
    v19 = *(WORD *)(a3 + 40);     
    v20 = pTextThis();     
    pRenderTextOut((int)v20, v19 - 10, v18,a1+760, 0, 0, 0, 0);   
}   
else   
{    //Simply drop!     
    v15 = (char *)pCursorY - 15;     
    v16 = pCursorX;     
    v17 = pTextThis();     
    pRenderTextOut((int)v17, (int)v16 - 10, (int)v15, a1 + 760, 0, 0, 8, 0);   
}   

v21 = pTextThis();   
pSetTextColor(pTextThis(),(int)v21, 0xFFu, 0xE6u, 0xC8u);   
pTextThis();   
return pSetBackgroundTextColor(pTextThis(),0, 0, 0, -1);   
}

Definición de Header (.H)

static void DrawBackgroundItem(int a1, int a2, int a3, int a4, int a5, signed int a6, char a7);
Definiciones (Defines)

Aquí tienes las definiciones necesarias para quien las necesite:

#define pTextThis ((LPVOID()()) 0x0041FE10) #define pSetTextColor ((void(__thiscall)(LPVOID This, BYTE r, BYTE g, BYTE b, BYTE h)) 0x420040) #define pSetBackgroundTextColor ((void(__thiscall*)(LPVOID This, int r, int g, int b, int h)) 0x004200B0) #define pSetFont ((int(__thiscall*)(LPVOID This, int a2)) 0x420120) #define pFontBold (HGDIOBJ)0x00E8C58C #define pRenderTextOut ((int(__thiscall*)(int This, int a2, int a3, int a4, int a5, int a6, int a7, int a8))0x00420150)
CRÉDITOS:
  • ¡A toda la comunidad de MU!
  • Y a mí (BonnY)
Bon Dia

🡱 🡳
Real Time Web Analytics