Añadir Sockets Manualmente a Armas y Escudos en MuOnline

Añadir Sockets Manualmente a Armas y Escudos en MuOnline (2)

En esta publicación, compartiré un fragmento de código que permite añadir sockets manualmente a diferentes tipos de armas y escudos en MuOnline. Este código es esencial para aquellos que desean personalizar sus objetos y mejorar su rendimiento en el juego.

BOOL  __stdcall ItemSocket(int Itemtype)
{
   if (Itemtype > 3092)
   {
      if (Itemtype > 4661)
      {
         if (Itemtype > 5685 || Itemtype < 5676 && (Itemtype < 5164 || Itemtype > 5173))
            return 0;
      }
      else if (Itemtype < 4652 && (Itemtype > 4149 || Itemtype < 4140 && (Itemtype < 3628 || Itemtype > 3637)))
      {
         return 0;
      }
      else if (Itemtype == 3613 || Itemtype == 4125 || Itemtype == 4637 || Itemtype == 5149 || Itemtype == 5661)
      {
         return 0;
      }
      else if (Itemtype == 3592 || Itemtype == 4104 || Itemtype == 4616 || Itemtype == 5128 || Itemtype == 5640 )//BRASS SET + SOCKET
      {
         return 0;
      }
      //IF YOU WHIS CONTINUED ADD ITEMS NORMAL OR CUSTOMITEM.. COPY AND PASTE ELSE IF OF NEXT FORM.. FOR CALCULATE ITEMS 512xITEM SECCION+INDEX..  512X7+8 = 3592 BRASS HELM
      //else if (Itemtype == 3592 || Itemtype == 4104 || Itemtype == 4616 || Itemtype == 5128 || Itemtype == 5640)/
      //{
         //return 0;
      //}

      return 1;
   }
   if (Itemtype >= 3089)
      return 1;
   if (Itemtype > 2071)
      return Itemtype == 2580 || Itemtype > 2589 && Itemtype <= 2592;
   return Itemtype == 2071 || Itemtype <= 1041 && (Itemtype >= 1040 || Itemtype >= 26 && Itemtype <= 28);
}


SetCompleteHook(0xE9, 0x00968180, &ItemSocket);

 

¿Qué Hace Este Código?

El código define una función llamada ItemSocket, que determina si un objeto puede tener un socket basado en su tipo. A continuación, desglosamos el código:

cpp

Copiar
BOOL __stdcall ItemSocket(int Itemtype)
{
if (Itemtype > 3092)
{
if (Itemtype > 4661)
{
if (Itemtype > 5685 || Itemtype < 5676 && (Itemtype < 5164 || Itemtype > 5173))
return 0;
}
else if (Itemtype < 4652 && (Itemtype > 4149 || Itemtype < 4140 && (Itemtype < 3628 || Itemtype > 3637)))
{
return 0;
}
else if (Itemtype == 3613 || Itemtype == 4125 || Itemtype == 4637 || Itemtype == 5149 || Itemtype == 5661)
{
return 0;
}
else if (Itemtype == 3592 || Itemtype == 4104 || Itemtype == 4616 || Itemtype == 5128 || Itemtype == 5640) // BRASS SET + SOCKET
{
return 0;
}
return 1;
}
if (Itemtype >= 3089)
return 1;
if (Itemtype > 2071)
return Itemtype == 2580 || Itemtype > 2589 && Itemtype <= 2592;
return Itemtype == 2071 || Itemtype <= 1041 && (Itemtype >= 1040 || Itemtype >= 26 && Itemtype <= 28);
}

  1. Verificación de Tipo de Ítem: La función recibe como parámetro el tipo de ítem (Itemtype) y verifica si es mayor a 3092. Dependiendo del valor de Itemtype, se aplican diferentes condiciones para determinar si un socket puede ser añadido.
  2. Condiciones de Exclusión: Se definen varias condiciones que excluyen ciertos ítems de recibir sockets. Si el tipo de ítem coincide con alguna de estas condiciones, la función devuelve 0, indicando que no se puede añadir un socket.
  3. Condiciones de Inclusión: Si el ítem cumple con los criterios especificados, se devuelve 1, lo que permite añadir un socket.
Añadir Sockets Manualmente a Armas y Escudos en MuOnline
Añadir Sockets Manualmente a Armas y Escudos en MuOnline

Integración en el Código Principal

Para integrar esta función en el código fuente principal, se utiliza la siguiente línea:

cpp

Copiar
SetCompleteHook(0xE9, 0x00968180, &ItemSocket);

Esto establece un gancho que permite que la función ItemSocket sea llamada en el momento adecuado dentro del flujo del programa.

Consideraciones Finales

Este código es útil para quienes desean personalizar su experiencia de juego en MuOnline añadiendo sockets a diferentes tipos de armas y escudos. Asegúrate de probar el código en un entorno seguro antes de implementarlo en tu servidor.

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *