Buenas gente hoy les comparto lo que pude hacer, ya que los files que uso no lo tenían es aumentar o disminuir la cantidad de rondas en duelos que hacen los pj me funciono a mi con mis files s6
lo siento si no es como se hace primera vez que hago algo de esto publicado! Me disculpo si no es de esta manera ojala se entienda! la mejor con el mundo de mu!!
https://ibb.co/B2bn9dDjGuía para agregar sistema de rondas configurables en duelos de MuEMU Season 6
==============================================================================
📅 Fecha: 26/06/2025
📂 Proyecto: GameServer MuEMU
🎮 Funcionalidad: Duelos con cantidad de rondas configurables
-------------------------------------------------------------------------------
1. ARCHIVO DE CONFIGURACIÓN - Common.dat
------------------------------------------
Agregá la siguiente línea en tu archivo:
Ruta: Data\Common.dat
[Duel]
DuelMaxRounds = 5
Este valor define cuántas rondas debe ganar un jugador para finalizar el duelo.
-------------------------------------------------------------------------------
2. MODIFICACIONES EN Duel.h
----------------------------
Dentro de la clase CDuel (al final, en private:), agregá:
int m_DuelMaxRounds;
Y en la parte pública si querés cargar por función:
void LoadConfig();
-------------------------------------------------------------------------------
3. MODIFICACIONES EN Duel.cpp
------------------------------
🔹 En CDuel::CDuel(), agregá esta línea para leer el valor de rondas:
this->m_DuelMaxRounds = GetPrivateProfileInt("Duel", "DuelMaxRounds", 5, ".\\Data\\Common.dat");
(Si usás una función LoadConfig(), ponelo ahí en su lugar).
🔹 En ResetDuel(), agregá:
lpObj->DuelRound = 0;
🔹 En UserDieProc(), reemplazá el contenido completo por la función modificada que:
- Suma rondas con DuelRound++
- Anuncia al jugador la ronda ganada
- Finaliza el duelo si se alcanzan las rondas máximas
-------------------------------------------------------------------------------
4. MODIFICACIONES EN User.h
-----------------------------
Dentro de la estructura OBJECTSTRUCT, agregá:
int DuelRound;
-------------------------------------------------------------------------------
5. MENSAJE EN PANTALLA - Reemplazo de GCServerMsgStringSend
-------------------------------------------------------------
Si te da error "GCServerMsgStringSend no definido", usá este reemplazo:
gNotice.GCNoticeSend(lpObj->Index, 1, 0, 0, 0, 0, 0, szMsg);
-------------------------------------------------------------------------------
6. CODIFICACIÓN DEL ARCHIVO (IMPORTANTE)
-----------------------------------------
Cuando guardes Duel.cpp o Duel.h, si te aparece el mensaje:
"¿Desea guardar como Unicode?"
✅ Elegí **Sí** y guardá como UTF-8 (sin BOM si tu editor lo permite).
Esto evita que se pierdan caracteres especiales como acentos.
-------------------------------------------------------------------------------
7. COMPILACIÓN
---------------
Luego de aplicar todos los cambios:
✅ Recompilá el GameServer.
✅ Reemplazá el ejecutable.
✅ Verificá en el cliente que los duelos ahora terminen según las rondas.
¡Listo! Ya tenés duelos con rondas configurables al estilo PvP competitivo.
-------------------------------------------------------------------------------
8. FUNCION COMPLETA: CDuel::UserDieProc()
------------------------------------------
Reemplazá la función entera en Duel.cpp por esta versión modificada:
void CDuel::UserDieProc(LPOBJ lpObj, LPOBJ lpTarget) // OK
{
if (this->CheckDuel(lpObj, lpTarget) == 0)
{
return;
}
// Aumentar puntuación
lpTarget->DuelScore++;
lpTarget->DuelRound++;
this->GCDuelScoreSend(lpObj->Index, lpTarget->Index);
#if(GAMESERVER_UPDATE>=402)
DUEL_ARENA_INFO* lpInfo = this->GetDuelArenaByGladiator(lpObj->Index);
if (lpInfo != 0)
{
this->GCDuelScoreSend(lpInfo);
}
#endif
// Anunciar ronda ganada
char szMsg[128];
sprintf(szMsg, "[Duel] %s ha ganado la ronda %d", lpTarget->Name, lpTarget->DuelRound);
gNotice.GCNoticeSend(lpTarget->Index, 1, 0, 0, 0, 0, 0, szMsg);
gNotice.GCNoticeSend(lpObj->Index, 1, 0, 0, 0, 0, 0, szMsg);
// Verificar si alcanzó la cantidad de rondas necesarias
if (lpTarget->DuelRound >= this->m_DuelMaxRounds)
{
gAchievements.DuelWin(lpTarget->Index);
this->ResetDuel(lpObj);
this->ResetDuel(lpTarget);
this->GCDuelEndSend(lpObj->Index, 0);
this->GCDuelEndSend(lpTarget->Index, 0);
GDRankingDuelSaveSend(lpTarget->Index, 1, 0);
GDRankingDuelSaveSend(lpObj->Index, 0, 1);
GCFireworksSend(lpTarget, lpTarget->X, lpTarget->Y);
#if(GAMESERVER_UPDATE>=402)
if (lpInfo != 0)
{
this->GCDuelWinSend(lpInfo, lpTarget->Name, lpObj->Name);
gEffectManager.AddEffect(lpTarget, 0, EFFECT_GLADIATORS_GLORY, 3600, 20, 0, 0, 0);
if (gServerInfo.m_DuelArenaAnnounceSwitch != 0)
{
gNotice.GCNoticeSendToAll(0, 0, 0, 0, 0, 0, gMessage.GetMessage(175), lpTarget->Name, lpObj->Name);
}
this->SetState(lpInfo, DA_STATE_CLEAN);
}
#endif
}
else
{
// Continuar siguiente ronda
this->RespawnDuelUser(lpObj);
this->RespawnDuelUser(lpTarget);
}
}
====================================================================================================================
Si esta mal o necesita mejora y quieren ayudar y aportar sea bienvenido pero a mi me funciono perfectamente