![]() |
|
How to show HP points and HP life bar on Monster? - Printable Version +- LCKB (https://lckb.dev/forum) +-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109) +--- Forum: Guides & Help Section (https://lckb.dev/forum/forumdisplay.php?fid=193) +---- Forum: Help & Support (https://lckb.dev/forum/forumdisplay.php?fid=157) +----- Forum: Ep4 Support (https://lckb.dev/forum/forumdisplay.php?fid=128) +----- Thread: How to show HP points and HP life bar on Monster? (/showthread.php?tid=4740) |
- Andrein95 - 05-19-2021 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; - Andrein95 - 05-01-2022 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 - Desarija - 05-02-2022 Add it into void CTargetInfoUI::UpdateHPInfo() I'd say - Andrein95 - 05-02-2022 34 minutes ago, Desarija said: Add it into void CTargetInfoUI::UpdateHPInfo() I'd say That function is not called. How to force call it? - Desarija - 05-02-2022 In my source it is called ? i think from myinfo.cpp, look for UpdateHPInfo there - Andrein95 - 05-02-2022 /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 - Andrein95 - 05-04-2022 /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) ? - Desarija - 05-04-2022 TargetInfo.tex - Andrein95 - 05-07-2022 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? - Andrein95 - 05-07-2022 /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? |