How to show HP points and HP life bar on Monster?
#11

This is my code:

switch( pInfo->GetTargetType(eTARGET) )
{
case MOB:
{
// Text color
nColorIdx = 4;
m_bShowHpBar = TRUE;
bHideHpString = FALSE;

// [2010/10/20 : Sora] ¸ó½ºÅÍ ¿ëº´ Ä«µå
if( pInfo->GetTargetEntity(eTARGET)->IsFirstExtraFlagOn(ENF_EX1_MONSTER_MERCENARY) )
{
strName = _S( 5151, "[¿ëº´]") + strName;
nColorIdx = 12;
}
else if ( pInfo->GetTargetEntity(eTARGET)->GetFirstExFlags() & ( ENF_EX1_TOTEM | ENF_EX1_TRAP | ENF_EX1_SUICIDE ) )
{
nColorIdx = 13;
}
else
{
int nLevelDiff = nLevel - _pNetwork->MyCharacterInfo.level;
if( nLevelDiff > 5 ) nColorIdx = 0;
else if( nLevelDiff > 2 ) nColorIdx = 1;
else if( nLevelDiff > -3 ) nColorIdx = 2;
else if( nLevelDiff > -6 ) nColorIdx = 3;
}

// Mob Level
if ( !( pInfo->GetTargetEntity(eTARGET)->GetFirstExFlags() & ( ENF_EX1_TOTEM | ENF_EX1_TRAP | ENF_EX1_SUICIDE ) ) )
{ // ÅäÅÛ, Æ®·¦, ÆÐ·¯»çÀÌÆ®´Â ·¹º§À» Ç¥½ÃÇÏÁö ¾Ê´Â´Ù.
bHideLevel = FALSE;
}
// rendering degli hp...
float fHealth = 0;
fHealth = pInfo->GetTargetCurHP(eTARGET);
strHp.PrintF("%d", (int)fHealth);
m_pText[eTEXT_HP]->SetText(strHp);
}
break;

 

#12


On 5/16/2021 at 1:57 AM, Desarija said:




I think in earlier versions of the client there was only uitargetinfo.cpp, and then they basically replaced it with targetinfonewui.cpp so that’s the file it uses now




After moving on november source still can't make update string of HP after damage.

Do you know how I can handle the damage calculation and monster life bar so I can upate HP string value? /index.php?/profile/18894-desarija/&do=hovercard" data-mentionid="18894" href="/index.php?/profile/18894-desarija/" rel="">@Desarija /index.php?/profile/21802-scura/&do=hovercard" data-mentionid="21802" href="/index.php?/profile/21802-scura/" rel="">@Scura

#13

Add it into void CTargetInfoUI::UpdateHPInfo() I'd say

#14


34 minutes ago, Desarija said:




Add it into void CTargetInfoUI::UpdateHPInfo() I'd say




That function is not called. How to force call it?

#15

In my source it is called ? i think from myinfo.cpp, look for UpdateHPInfo there

#16

/index.php?/profile/18894-desarija/&do=hovercard" data-mentionid="18894" href="/index.php?/profile/18894-desarija/" rel="">@Desarija Sorry bro, I'll debug better later and let u know

#17

 /index.php?/profile/18894-desarija/&do=hovercard" data-mentionid="18894" href="/index.php?/profile/18894-desarija/" rel="">@Desarija Thank you, it works! In this file where can I change the color of the bar (default red) ?

#18

TargetInfo.tex

#19


On 5/5/2022 at 1:45 AM, Desarija said:




TargetInfo.tex




How to swap character of mob target with this:

/monthly_2022_05/image.png.f7f57a1ca4395368c1f08a69677bfd06.png" />

and do you know where HP decrease/increase handler is defined?

 

#20

/index.php?/profile/18894-desarija/&do=hovercard" data-mentionid="18894" href="/index.php?/profile/18894-desarija/" rel="">@Desarija /index.php?/profile/21749-dimaflash/&do=hovercard" data-mentionid="21749" href="/index.php?/profile/21749-dimaflash/" rel="">@Dimaflash

In the end everything works, the only thing that I can't make it works is to update current target while regenerating HP (example sit down), the HP regenerated of other characters does not trigger UpdateHPInfo().

Do you have any hint?



Forum Jump:


Users browsing this thread: 1 Guest(s)