in HG srcs (Game.cpp)
in iComposeInitMapData and moree thinks
Code: Select all
*cp = (char)(CMisc::CalcHPPerc(m_pClientList[pTile->m_sOwner]->m_iHP, iGetMaxHP(pTile->m_sOwner)));
cp++;
iSize++;
VERY IMPORTANT CODE -> in misc.cpp
Code: Select all
// Helbreath II
int CMisc::CalcHPPerc(int iCurHP, int iMaxHP) {
double dCurHP, dMaxHP;
double dPerc;
dCurHP = (double)iCurHP;
dMaxHP = (double)iMaxHP;
dPerc = (dCurHP / dMaxHP) * 100.0;
if (dPerc < 0.0) dPerc = 0.0;
if (dPerc > 100.0) dPerc = 100.0;
return (int)dPerc;
}
game.cpp
variable _tmp_iHPPerc is in all src!!!!!
look this:
in DrawObjectName and DrawNPCName
Code: Select all
m_pSprite[DEF_SPRID_INTERFACE_ADDINTERFACE]->PutSpriteFast(sX, sY + 32 + iAddY, 24, dwTime);
m_pSprite[DEF_SPRID_INTERFACE_ADDINTERFACE]->PutSpriteFastWidth(sX + 1, sY + 33 + iAddY, 25, (int)(66.0f * ((double)iHPPerc / 100.0f)), dwTime);
wsprintf(cTxt2, "%d%%", iHPPerc);
PutString2(sX + 22, sY + 31 + iAddY, cTxt2, 240, 240, 240);
well when i add all variables in my scrs code i have 4 errors....