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

Resultados por:
 

 


Rechercher Búsqueda avanzada
Últimos temas
» HELBREATH 2018
7/18/2018, 4:27 am por borsalinofede

» HB OXY 3.82 + CLIENTE + LOGIN.CFG
7/4/2018, 8:45 am por luquitomas

» HB VILLA URQUIZA NUEVO!!!!!!!
7/2/2018, 4:15 pm por elperro

» Hb Cordoba v4.0 (SRC + Files + CNTS + SPRITES )
6/30/2018, 10:29 am por elperro

» [SRC+FILES] HGServer-Client-Files
4/4/2018, 1:27 pm por Centuu.-

» Helbreath Hack Video
3/28/2018, 3:43 pm por Geral

» Crear una nueva magia
3/4/2018, 11:29 am por jhari

» Files Helbreath Santana v3.51 ( Files + SRC + SPRITES)
3/2/2018, 5:39 pm por jhari

» Busco Programadores para servidor de helbreath
3/1/2018, 4:55 pm por walac

» Ayuda con anti hacks
2/22/2018, 9:45 pm por Iara

» HELBREATH BLOODY GAMES
1/24/2018, 11:56 am por Gerion

» Busco programador para levantar un server de Helbreath.. Buena paga!!!
1/11/2018, 2:19 pm por kikixxx

Los posteadores más activos del mes
elperro
 
luquitomas
 
borsalinofede
 
Rankings
Helbreath Top 10
Helbreath Top 50
Julio 2018
LunMarMiérJueVieSábDom
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
CalendarioCalendario

Comparte | 
 

 [CODE] MP,HP,SP, EN COLORES

Ir abajo 
AutorMensaje
Krhiz
Level 31/180
Level 31/180
avatar

C++ Level :
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
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: