• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

how fix whit crowtargetinfo not show HP bar

Skilled Illusionist
Joined
Feb 17, 2012
Messages
307
Reaction score
18
i fix crow for show tab bar HP but not show show NPC only how i get code to show mob
CrowTargetInfoNpc.cpp ? or other file

this photo
 
Skilled Illusionist
Joined
Feb 17, 2012
Messages
307
Reaction score
18
#include "StdAfx.h"
#include "CrowTargetInfoNpc.h"
#include "InnerInterface.h"
#include "BasicLineBox.h"
#include "../EngineLib/DxCommon/d3dfont.h"
#include "../EngineLib/DxCommon/DxFontMan.h"
#include "BasicLineBox.h"
#include "BasicLineBoxEx.h"
#include "../Interface/GameTextControl.h"
#include "../Interface/UITextControl.h"
#include "../EngineUILib/GUInterface/BasicTextBox.h"

#include "../RanClientLib/G-Logic/GLGaeaClient.h"
#include "../RanClientLib/G-Logic/GLCrowData.h"
#include "../RanClientLib/G-Logic/GLCrow.h"
#include "../RanClientLib/G-Logic/GLCrowClient.h"
#include "../RanClientLib/G-Logic/GlogicEx.h"

#include "GLCharData.h"
#include "GLCharacter.h"
#include "GLChar.h"
#include "GLCharClient.h"
#include "GLogicData.h"
#include "GLCharDefine.h"
#include "UIInfoLoader.h"
#include "GLCrowRenList.h"
#include "GLStringTable.h"
#include "../RanClientLib/NpcTalk/NpcTalk.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

CCrowTargetInfoNpc::CCrowTargetInfoNpc () :
m_pNameBoxDummy ( NULL )
{
}

CCrowTargetInfoNpc::~CCrowTargetInfoNpc ()
{
}

void CCrowTargetInfoNpc::CreateSubControl ()
{
m_pFont8 = DxFontMan::GetInstance().LoadDxFont ( _DEFAULT_FONT, 9, _DEFAULT_FONT_FLAG );

m_pTargetBox = new CBasicLineBoxEx;
m_pTargetBox->CreateSub ( this, "BASIC_LINE_BOX_EX_DIALOGUE_WHITE", UI_FLAG_XSIZE | UI_FLAG_YSIZE );
m_pTargetBox->CreateBaseBoxDialogueLightGray ( "RNCROW_TARGET_INFOBOX_NPC" );
m_pTargetBox->SetVisibleSingle ( TRUE );
RegisterControl ( m_pTargetBox );

CBasicTextBox* m_pHP = new CBasicTextBox;
m_pHP->CreateSub ( this, "HP_NAMEBOX_NPC" );
m_pHP->SetFont ( m_pFont8 );
m_pHP->SetTextAlign ( TEXT_ALIGN_LEFT );
m_pHP->SetControlNameEx ( "HP Text" );
m_pHP->SetAlignFlag ( UI_FLAG_XSIZE | UI_FLAG_YSIZE );
RegisterControl ( m_pHP );
m_pHPBox = m_pHP;

CBasicTextBox* pNameBox = new CBasicTextBox;
pNameBox->CreateSub ( this, "CROW_NAMEBOX_NPC" );
pNameBox->SetFont ( m_pFont8 );
pNameBox->SetTextAlign ( TEXT_ALIGN_LEFT );
pNameBox->SetControlNameEx ( "HP Text" );
pNameBox->SetAlignFlag ( UI_FLAG_XSIZE | UI_FLAG_YSIZE );
RegisterControl ( pNameBox );
m_pNameBox = pNameBox;

m_pNameBoxDummy = CreateControl ( "CROW_NAMEBOX_NPC", UI_FLAG_XSIZE | UI_FLAG_YSIZE );
}

CUIControl* CCrowTargetInfoNpc::CreateControl ( const char* szControl, WORD wAlignFlag )
{
CUIControl* pControl = new CUIControl;
pControl->CreateSub ( this, szControl, wAlignFlag );
RegisterControl ( pControl );
return pControl;
}

void CCrowTargetInfoNpc::SetTargetInfo ( CString strName )
{
CString strCombine;
CString combine;
strCombine.Format ( "[Npc Type]");
m_pHPBox->SetOneLineText ( strCombine, NS_UITEXTCOLOR:ODGERBLUE );
m_pNameBox->ClearText ();

SIZE Size;
m_pFont8->GetTextExtent ( strName.GetString (), Size );

CString strTemp;
strTemp.Format ( "%s", strName );
m_pNameBox->SetOneLineText ( strTemp, NS_UITEXTCOLOR::LIME );
m_strName = strName;
}
 
Upvote 0
Banned
Banned
Joined
Mar 21, 2013
Messages
225
Reaction score
18
your code is exactly the same as mine, I think thats not a problem.



Do you want NPC to display hitpoints like mobs?

 

Attachments

You must be registered for see attachments list
Upvote 0
Banned
Banned
Joined
Mar 21, 2013
Messages
225
Reaction score
18
yes i want NPC to display hitpoints like mobs
ok, replace the parameters inside the method SetTargetInfo in CrowTargetInfoNPC.cpp
so it should look like this ↓

Code:
void CCrowTargetInfoNpc::SetTargetInfo ( [COLOR=#ff0000]int fNow, int fMax, int fPercent,DWORD Level,  CString strName[/COLOR] )
{        

CString strCombine;    
CString combine;    

[COLOR=#ff0000]strCombine.Format ( "%d/%d (%d", fNow,fMax,fPercent );        
strCombine += "%)";        
m_pHPBox->SetOneLineText ( strCombine, NS_UITEXTCOLOR::GOLD );[/COLOR]    
m_pNameBox->ClearText ();        


SIZE Size;    
m_pFont8->GetTextExtent ( strName.GetString (), Size );        


CString strTemp;    strTemp.Format ( "%s", strName );    
m_pNameBox->SetOneLineText ( strTemp, NS_UITEXTCOLOR::LIME );        
m_strName = strName;

}

and in CrowTargetInfoNPC.h

change from:
Code:
void    SetTargetInfo ( CString strName );

to:
Code:
[COLOR=#ff0000]void    SetTargetInfo ( int fNow, int fMax, int fPercent,DWORD Level , CString strName, STARGETID sTargetID  );
[/COLOR]

I just merged CrowTargetInfo.cpp into CrowTargetInfoNPC.cpp
I hope it helps. Good Luck!
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Feb 24, 2015
Messages
57
Reaction score
7
InnerInterfaceSimple.cpp
Find "crowtarget" merge form source ep11



if ( pCOPY->GetCrow() == CROW_MOB || pCOPY->GetCrow() == CROW_SUMMON ){ dwColor = GLGaeaClient::GetInstance().GetMobNameColor ( sTargetID.dwID );}
Repalce
if ( pCOPY->GetCrow() == CROW_MOB || pCOPY->GetCrow() == CROW_SUMMON ){ dwColor = GLGaeaClient::GetInstance().GetMobNameColor ( sTargetID.dwID ); int fPercent2 = (int)(float(sHP.dwNow) / float(sHP.dwMax)) * 100; if ( m_pCrowTargetInfo ) m_pCrowTargetInfo->SetTargetInfo ( sHP.dwNow, sHP.dwMax, fPercent2, pCrow->GETLEVEL(), strName, sTargetID ); ShowGroupBottom ( CROW_TARGET_INFO );}
 
Upvote 0