¡Desarrollando Helbreath para jugadores por jugadores!
 
ÍndicePublicacionesBuscarMiembrosGrupos de UsuariosRegistrarseConectarse
Buscar
 
 

Resultados por:
 

 


Rechercher Búsqueda avanzada
Últimos temas
» Helbreath Chaos Legion (Files + Sources)
12/4/2017, 6:23 am por nicoprs

» Helbreath Server V 3.82
12/4/2017, 3:47 am por nicoprs

» HB Adventure ( FILES + SRC + SPRITES)
12/4/2017, 2:59 am por nicoprs

» Helbreath Windows (Files + Sources)
12/4/2017, 2:49 am por nicoprs

» HB Centenario (SRC+Server+Files)
12/3/2017, 10:26 pm por nicoprs

» [SRC+FILES] HGServer-Client-Files
10/19/2017, 11:25 am por twal

» Cambiar max level Server files 3.82
9/13/2017, 10:41 pm por GM3

» Cambiar max level Server files 3.82
9/12/2017, 4:26 pm por nicoprs

» Únase a nosotros de nuevo en http://helbreath.online/
8/24/2017, 9:53 pm por Genesis

» Cual es la respuesta a la pregunta del nuevo foro?
8/24/2017, 9:50 pm por Genesis

» Pit clops puerta elvine d2
8/3/2017, 8:45 pm por kamikaze

» SPRITE PUNTERO
7/22/2017, 7:36 pm por Maty Vega

Los posteadores más activos del mes
nicoprs
 
Rankings
Helbreath Top 10
Helbreath Top 50
Diciembre 2017
LunMarMiérJueVieSábDom
    123
45678910
11121314151617
18192021222324
25262728293031
CalendarioCalendario

Comparte | 
 

 [CODE] MP,HP,SP, EN COLORES

Ver el tema anterior Ver el tema siguiente Ir abajo 
AutorMensaje
Krhiz
Level 31/180
Level 31/180
avatar

Coding Lvl (C++) :
0 / 50 / 5

Desde : 02/03/2014
Nación : Aresden
Posts : 23

MensajeTema: [CODE] MP,HP,SP, EN COLORES   11/8/2014, 1:34 am

Bueno este code funciona para ver cuando el HP, MP y SP aumenta o disminuye, en colores, es decir, la HP en rojo, el MP en azul, y la SP en verde.

Lo primero que debes hacer es ir a los Sources del Client y buscar en Game.cpp el siguiente método:

Código:
void CGame::DrawDialogBox_Chat(short msX, short msY, short msZ, char cLB)

A continuación, dentro de ese método buscca lo siguiente:

Código:
case 10: PutString2(sX + 25, sY + 127 - i*13, m_pChatScrollList[i + m_stDialogBoxInfo[10].sView]->m_pMsg, 180, 255, 180); break;

Por debajo de eso agrega:

Código:
case 11: PutString2(sX + 25, sY + 127 - i*13, m_pChatScrollList[i + m_stDialogBoxInfo[10].sView]->m_pMsg, 25, 25, 112); break; // MP[size=13][/size]
case 12: PutString2(sX + 25, sY + 127 - i*13, m_pChatScrollList[i + m_stDialogBoxInfo[10].sView]->m_pMsg, 255, 0, 0); break; // HP[size=13][/size]
case 13: PutString2(sX + 25, sY + 127 - i*13, m_pChatScrollList[i + m_stDialogBoxInfo[10].sView]->m_pMsg, 0, 100, 0); break; // SP[size=13][/size]

Luego, busca el siguiente método:

Código:
void CGame::ShowEventList(DWORD dwTime)[size=13][/size]

Dentro de ese método, busque el siguiente:

Código:
case 10:[size=13][/size]
PutString(10, 10 + i*15, m_stEventHistory[i].cTxt, RGB(180,255,180), FALSE, 1, TRUE);[size=13][/size]
break;

Debajo agregar:

Código:
case 11:[size=13][/size]
PutString(10, 10 + i*15, m_stEventHistory[i].cTxt, RGB(25,25,112), FALSE, 1, TRUE); // MP[size=13][/size]
break;[size=13][/size]
case 12:[size=13][/size]
PutString(10, 10 + i*15, m_stEventHistory[i].cTxt, RGB(255,0,0), FALSE, 1, TRUE); // HP[size=13][/size]
break;[size=13][/size]
case 13:[size=13][/size]
PutString(10, 10 + i*15, m_stEventHistory[i].cTxt, RGB(0,100,0), FALSE, 1, TRUE); // SP[size=13][/size]
break;

En ese mismo método volver a buscar:

Código:
case 10:[size=13][/size]
PutString(10, 322 + i*15, m_stEventHistory2[i].cTxt, RGB(180,255,180), FALSE, 1, TRUE);[size=13][/size]
break;

Debajo de eso agregar:

Código:
case 11:[size=13][/size]
PutString(10, 322 + i*15, m_stEventHistory2[i].cTxt, RGB(25,25,112), FALSE, 1, TRUE); // MP[size=13][/size]
break;[size=13][/size]
case 12:[size=13][/size]
PutString(10, 322 + i*15, m_stEventHistory2[i].cTxt, RGB(255,0,0), FALSE, 1, TRUE); // HP[size=13][/size]
break;[size=13][/size]
case 13:[size=13][/size]
PutString(10, 322 + i*15, m_stEventHistory2[i].cTxt, RGB(0,100,0), FALSE, 1, TRUE); // SP[size=13][/size]
break;[size=13][/size]

Ahora lo que hacemos es reemplazar los métodos siguientes:

Código:
void CGame::NotifyMsg_MP(char * pData)[size=13][/size]
{DWORD * dwp;[size=13][/size]
int iPrevMP;[size=13][/size]
char cTxt[120];[size=13][/size]
iPrevMP = m_iMP;[size=13][/size]
dwp = (DWORD *)(pData + DEF_INDEX2_MSGTYPE + 2);[size=13][/size]
m_iMP = (int)*dwp;[size=13][/size]
if (abs(m_iMP - iPrevMP) < 10) return;[size=13][/size]
if (m_iMP > iPrevMP)[size=13][/size]
{ wsprintf(cTxt, NOTIFYMSG_MP_UP, m_iMP - iPrevMP);[size=13][/size]
TestList(cTxt, 11);[size=13][/size]
PlaySound('E', 21, 0);[size=13][/size]
}else[size=13][/size]
{ wsprintf(cTxt, NOTIFYMSG_MP_DOWN, iPrevMP - m_iMP);[size=13][/size]
TestList(cTxt, 11);[size=13][/size]
}[size=13][/size]
}[size=13][/size]
[size=13][/size]
[size=13][/size]
[size=13][/size]
void CGame::NotifyMsg_SP(char * pData)[size=13][/size]
{DWORD * dwp;[size=13][/size]
int iPrevSP;[size=13][/size]
iPrevSP = m_iSP;[size=13][/size]
dwp = (DWORD *)(pData + DEF_INDEX2_MSGTYPE + 2);[size=13][/size]
m_iSP = (int)*dwp;[size=13][/size]
if (abs(m_iSP - iPrevSP) < 10) return;[size=13][/size]
if (m_iSP > iPrevSP)[size=13][/size]
{ wsprintf(G_cTxt, NOTIFYMSG_SP_UP, m_iSP - iPrevSP);[size=13][/size]
TestList(G_cTxt, 13);[size=13][/size]
PlaySound('E', 21, 0);[size=13][/size]
}else[size=13][/size]
{ wsprintf(G_cTxt, NOTIFYMSG_SP_DOWN, iPrevSP - m_iSP);[size=13][/size]
TestList(G_cTxt, 13);[size=13][/size]
}[size=13][/size]
}[size=13][/size]
[size=13][/size]
[size=13][/size]
[size=13][/size]
void CGame::NotifyMsg_HP(char * pData)[size=13][/size]
{[size=13][/size]
DWORD * dwp;[size=13][/size]
int iPrevHP;[size=13][/size]
char cTxt[120];[size=13][/size]
int iPrevMP;[size=13][/size]
[size=13][/size]
iPrevHP = m_iHP;[size=13][/size]
dwp = (DWORD *)(pData + DEF_INDEX2_MSGTYPE + 2);[size=13][/size]
m_iHP = (int)*dwp;[size=13][/size]
[size=13][/size]
iPrevMP = m_iMP;[size=13][/size]
dwp = (DWORD *)(pData + DEF_INDEX2_MSGTYPE + 6);[size=13][/size]
m_iMP = (int)*dwp;[size=13][/size]
[size=13][/size]
if (m_iHP > iPrevHP)[size=13][/size]
{ if ((m_iHP - iPrevHP) < 10) return;[size=13][/size]
wsprintf(cTxt, NOTIFYMSG_HP_UP, m_iHP - iPrevHP); // danette[size=13][/size]
TestList(cTxt, 12);[size=13][/size]
PlaySound('E', 21, 0);[size=13][/size]
}else[size=13][/size]
{ if ( (m_cLogOutCount > 0) && (m_bForceDisconn==FALSE) )[size=13][/size]
{ m_cLogOutCount = -1;[size=13][/size]
TestList(NOTIFYMSG_HP2, 10);[size=13][/size]
}[size=13][/size]
m_dwDamagedTime = timeGetTime();[size=13][/size]
if (m_iHP < 20) AddEventList(NOTIFYMSG_HP3, 10);[size=13][/size]
if ((iPrevHP - m_iHP) < 10) return;[size=13][/size]
wsprintf(cTxt, NOTIFYMSG_HP_DOWN, iPrevHP - m_iHP); // danette[size=13][/size]
TestList(cTxt, 12);[size=13][/size]
}[size=13][/size]
}[size=13][/size]


Luego debemos reemplazar este case:

Código:
case DEF_OBJECTMOVE_CONFIRM:[size=13][/size]
sp = (short *)cp;[size=13][/size]
sX = *sp;[size=13][/size]
cp += 2;[size=13][/size]
sp = (short *)cp;[size=13][/size]
sY = *sp;[size=13][/size]
cp += 2;[size=13][/size]
cDir = *cp;[size=13][/size]
cp++;[size=13][/size]
m_iSP = m_iSP - *cp;[size=13][/size]
cp++;[size=13][/size]
if( m_iSP < 0 ) m_iSP = 0;[size=13][/size]
// v1.3[size=13][/size]
//m_iOccupyStatus = (int)*cp;[size=13][/size]
cp++;[size=13][/size]
// v1.4[size=13][/size]
iPreHP = m_iHP;[size=13][/size]
ip = (int *)cp;[size=13][/size]
m_iHP = *ip;[size=13][/size]
cp += 4;[size=13][/size]
[size=13][/size]
if (m_iHP != iPreHP)[size=13][/size]
{ if (m_iHP < iPreHP)[size=13][/size]
{ wsprintf(G_cTxt, NOTIFYMSG_HP_DOWN, iPreHP - m_iHP);[size=13][/size]
TestList(G_cTxt, 12);[size=13][/size]
m_dwDamagedTime = timeGetTime();[size=13][/size]
if ((m_cLogOutCount>0) && (m_bForceDisconn==FALSE))[size=13][/size]
{ m_cLogOutCount = -1;[size=13][/size]
TestList(MOTION_RESPONSE_HANDLER2, 10);[size=13][/size]
}[size=13][/size]
}else[size=13][/size]
{ wsprintf(G_cTxt, NOTIFYMSG_HP_UP, m_iHP - iPreHP);[size=13][/size]
TestList(G_cTxt, 12);[size=13][/size]
} }[size=13][/size]
m_pMapData->ShiftMapData(cDir);[size=13][/size]
_ReadMapData(sX, sY, cp);[size=13][/size]
m_bIsRedrawPDBGS = TRUE;[size=13][/size]
m_cCommandCount--;[size=13][/size]
break;

Agregar el siguiente método:

Código:
void CGame::TestList(char * pTxt, char cColor, BOOL bDupAllow)[size=13][/size]
{int i;[size=13][/size]
if ((bDupAllow == FALSE) && (strcmp(m_stEventHistory[5].cTxt, pTxt) == 0)) return;[size=13][/size]
if (cColor == 11, 12, 13)[size=13][/size]
{ for (i = 1; i < 6; i++)[size=13][/size]
{ strcpy(m_stEventHistory2[i-1].cTxt, m_stEventHistory2[i].cTxt);[size=13][/size]
m_stEventHistory2[i-1].cColor = m_stEventHistory2[i].cColor;[size=13][/size]
m_stEventHistory2[i-1].dwTime = m_stEventHistory2[i].dwTime;[size=13][/size]
}[size=13][/size]
ZeroMemory(m_stEventHistory2[5].cTxt, sizeof(m_stEventHistory2[5].cTxt));[size=13][/size]
strcpy(m_stEventHistory2[5].cTxt, pTxt);[size=13][/size]
m_stEventHistory2[5].cColor = cColor;[size=13][/size]
m_stEventHistory2[5].dwTime = m_dwCurTime;[size=13][/size]
}else[size=13][/size]
{ for (i = 1; i < 6; i++)[size=13][/size]
{ strcpy(m_stEventHistory[i-1].cTxt, m_stEventHistory[i].cTxt);[size=13][/size]
m_stEventHistory[i-1].cColor = m_stEventHistory[i].cColor;[size=13][/size]
m_stEventHistory[i-1].dwTime = m_stEventHistory[i].dwTime;[size=13][/size]
}[size=13][/size]
ZeroMemory(m_stEventHistory[5].cTxt, sizeof(m_stEventHistory[5].cTxt));[size=13][/size]
strcpy(m_stEventHistory[5].cTxt, pTxt);[size=13][/size]
m_stEventHistory[5].cColor = cColor;[size=13][/size]
m_stEventHistory[5].dwTime = m_dwCurTime;[size=13][/size]
}[size=13][/size]
}

Y finalmente declaramos en Game.h:

Código:
void TestList(char * pTxt, char cColor = 0, BOOL bDupAllow = TRUE);

Por BLAZER Y Fakku. Espero que disfruten el código :)

________________________________________
[Tienes que estar registrado y conectado para ver esa imagen]
Volver arriba Ir abajo
Ver perfil de usuario
 
[CODE] MP,HP,SP, EN COLORES
Ver el tema anterior Ver el tema siguiente Volver arriba 
Página 1 de 1.

Permisos de este foro:No puedes responder a temas en este foro.
Comunidad Warehouse Helbreath :: Desarrollo de Helbreath :: Programación :: Códigos no ordenados-
Cambiar a: