Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Tweaked target bar [V15]

Newbie Spellweaver
Joined
Oct 4, 2022
Messages
38
Reaction score
54
This is not something big but i made some little changes to it and maybe one of you can make use of it



Its basically just a userfriendly version of the v15 target bar with a tooltip for elements + it displays the class of a player

Icons :

Place the dds and the inc file into you Client/Icon folder

Code :
WndWorld.cpp
completely replace the "void CWndWorld::RenderSelectObj" part with this
Code:
[COLOR=#000000][COLOR=#0000ff]#ifdef __NEW_TARGET[/COLOR]
[COLOR=#0000ff]void[/COLOR] CWndWorld::RenderSelectObj( C2DRender[COLOR=#0000ff]*[/COLOR] p2DRender, CObj[COLOR=#0000ff]*[/COLOR] pObj )
{
    CWorld* pWorld  = g_WorldMng.Get();

    [COLOR=#0000ff]if[/COLOR]( m_pRenderTargetObj )
        pObj = m_pRenderTargetObj;

    [COLOR=#0000ff]if[/COLOR]( pObj && pObj->GetType() == OT_MOVER )
    {
        CMover* pMover = (CMover*)pObj;

        [COLOR=#0000ff]if[/COLOR]( IsValidObj( pMover ) && ( pMover->IsPeaceful() == FALSE || pMover->IsPlayer() ) )
        {
            BOOL bSkip = FALSE;

[COLOR=#008000]           //__INVISIBLE_FIX[/COLOR]
            [COLOR=#0000ff]if[/COLOR]( pMover->HasBuff( BUFF_SKILL, SI_ACR_SUP_DARKILLUSION )
                || pMover->IsMode( TRANSPARENT_MODE )
[COLOR=#008000]               /*|| pMover->HasBuffByIk3(IK3_TEXT_DISGUISE ) <-- up to you. it is used in the original code*/[/COLOR])
            {
                bSkip = !g_pPlayer->IsAuthHigher( AUTH_GAMEMASTER );
            }

            [COLOR=#0000ff]if[/COLOR]( !bSkip )
            {
                CD3DFont* pOldFont = p2DRender->GetFont();
                p2DRender->SetFont( m_Theme.m_pFontWorld );
                DWORD dwFontColor;
                [COLOR=#0000ff]bool[/COLOR] bShowHp = [COLOR=#0000ff]true[/COLOR];

                TCHAR   szText[[COLOR=#098658]128[/COLOR]];
                TCHAR   szLevel[[COLOR=#098658]128[/COLOR]];
                TCHAR   szHealth[[COLOR=#098658]128[/COLOR]];

                [COLOR=#0000ff]int[/COLOR] nWidthClient = [COLOR=#098658]200[/COLOR];
                [COLOR=#0000ff]int[/COLOR] nWidth;
                CRect rect;

                nWidth = ([COLOR=#0000ff]int[/COLOR])( (__int64)nWidthClient * (__int64)pMover->GetHitPoint() / (__int64)pMover->GetMaxHitPoint() );
                [COLOR=#0000ff]int[/COLOR] nPos = ( GetClientRect().Width() - nWidthClient ) / [COLOR=#098658]2[/COLOR];
                rect = CRect( nPos, [COLOR=#098658]30[/COLOR], nPos + nWidthClient, [COLOR=#098658]0[/COLOR] );
                CPoint point = rect.TopLeft();
                CRect rectTemp = rect;
                rectTemp.right = rectTemp.left + nWidth;

                ClientToScreen( rect );
                ClientToScreen( rectTemp );
                m_Theme.MakeGaugeVertex( p2DRender->m_pd3dDevice, &rect, D3DCOLOR_ARGB( [COLOR=#098658]200[/COLOR], [COLOR=#098658]255[/COLOR], [COLOR=#098658]255[/COLOR], [COLOR=#098658]255[/COLOR] ), m_pVBGauge, &m_texGauEmptyNormal );
                m_Theme.RenderGauge( p2DRender->m_pd3dDevice, m_pVBGauge, &m_texGauEmptyNormal );
                m_Theme.MakeGaugeVertex( p2DRender->m_pd3dDevice, &rectTemp, D3DCOLOR_ARGB( [COLOR=#098658]128[/COLOR], [COLOR=#098658]255[/COLOR], [COLOR=#098658]15[/COLOR], [COLOR=#098658]15[/COLOR] ), m_pVBGauge, &m_texGauEmptyNormal );
                m_Theme.RenderGauge( p2DRender->m_pd3dDevice, m_pVBGauge, &m_texGauEmptyNormal );

                sprintf( szText, [COLOR=#a31515]"%s"[/COLOR], pMover->GetName());
                sprintf( szLevel, [COLOR=#a31515]"Lv. %d"[/COLOR], pMover->GetLevel());
                sprintf( szHealth, [COLOR=#a31515]"%d / %d"[/COLOR], pMover->GetHitPoint(), pMover->GetMaxHitPoint() );

                [COLOR=#0000ff]int[/COLOR] xAdjust = [COLOR=#098658]0[/COLOR];

                [COLOR=#0000ff]if[/COLOR]( pMover->IsPlayer() )
                {
                    [COLOR=#0000ff]if[/COLOR] ( pMover->IsAuthHigher(AUTH_JOURNALIST) )
                        sprintf( szText, [COLOR=#a31515]"[Staff] %s"[/COLOR], pMover->GetName());

                    [COLOR=#0000ff]if[/COLOR] ( pMover->IsLegendHero() || pMover->IsHero() )
                        sprintf( szLevel, [COLOR=#a31515]"Lv. %d - H"[/COLOR], pMover->GetLevel());
                    [COLOR=#0000ff]else[/COLOR] [COLOR=#0000ff]if[/COLOR] ( pMover->IsMaster() )
                        sprintf( szLevel, [COLOR=#a31515]"Lv. %d - M"[/COLOR], pMover->GetLevel());


                    xAdjust = [COLOR=#098658]23[/COLOR];
                    dwFontColor = COLOR_MONSTER;
                    bShowHp = g_pPlayer->IsAuthHigher( AUTH_JOURNALIST ) ? [COLOR=#0000ff]true[/COLOR] : [COLOR=#0000ff]false[/COLOR];[COLOR=#008000] // Only showing player hp for staff[/COLOR]
                    m_texJobIcon.Render( p2DRender, CPoint(point.x, point.y - [COLOR=#098658]22[/COLOR]  ), pMover->GetJob(), [COLOR=#098658]255[/COLOR], [COLOR=#098658]1.2f[/COLOR], [COLOR=#098658]1.2f[/COLOR] );
                }
                [COLOR=#0000ff]else[/COLOR]
                {
                    [COLOR=#0000ff]char[/COLOR]* szElementString[] = {
                        [COLOR=#a31515]"None"[/COLOR],
                        [COLOR=#a31515]"Fire"[/COLOR],
                        [COLOR=#a31515]"Water"[/COLOR],
                        [COLOR=#a31515]"Electric"[/COLOR],
                        [COLOR=#a31515]"Wind"[/COLOR],
                        [COLOR=#a31515]"Earth"[/COLOR]
                    };

                    [COLOR=#0000ff]char[/COLOR]* szEffectiveElementString[] = {
                        [COLOR=#a31515]"None"[/COLOR],
                        [COLOR=#a31515]"Water"[/COLOR],
                        [COLOR=#a31515]"Electirc"[/COLOR],
                        [COLOR=#a31515]"Earth"[/COLOR],
                        [COLOR=#a31515]"Fire"[/COLOR],
                        [COLOR=#a31515]"Wind"[/COLOR]
                    };

                    CEditString strEdit;
                    CString szString;
                    CRect tempRect = CRect( nPos, [COLOR=#098658]0[/COLOR], nPos + nWidthClient, [COLOR=#098658]30[/COLOR] );
                    CPoint ptMouse = GetMousePoint();

                    strEdit.AddString( pMover->GetName(), [COLOR=#098658]0xff2fbe6d[/COLOR], ESSTY_BOLD );
                    strEdit.AddString( [COLOR=#a31515]"\n"[/COLOR] );

                    szString.Format( [COLOR=#a31515]"Element : %s\n"[/COLOR], szElementString[pMover->GetProp()->eElementType] );
                    strEdit.AddString( szString );

                    [COLOR=#0000ff]if[/COLOR]( pMover->GetProp() && pMover->GetProp()->eElementType)
                    {
                        xAdjust = [COLOR=#098658]28[/COLOR];
                        m_texAttrIcon.Render( p2DRender, CPoint(point.x, point.y - [COLOR=#098658]25[/COLOR] ), pMover->GetProp()->eElementType - [COLOR=#098658]1[/COLOR], [COLOR=#098658]255[/COLOR], [COLOR=#098658]1.5f[/COLOR], [COLOR=#098658]1.5f[/COLOR] );

                        szString.Format( [COLOR=#a31515]"Effective Element : %s\n"[/COLOR], szEffectiveElementString[pMover->GetProp()->eElementType] );
                        strEdit.AddString( szString );
                    }
                    [COLOR=#0000ff]else[/COLOR]
                        xAdjust = [COLOR=#098658]0[/COLOR];

                    szString.Format( [COLOR=#a31515]"Level : %d\n"[/COLOR] , pMover->GetLevel());
                    strEdit.AddString( szString );

                    g_toolTip.PutToolTip( [COLOR=#098658]100[/COLOR], strEdit, tempRect, ptMouse, [COLOR=#098658]1[/COLOR] );
                    dwFontColor = pMover->m_bActiveAttack ? [COLOR=#098658]0xffff0000[/COLOR] : COLOR_MONSTER;
                }
                p2DRender->TextOut( point.x + xAdjust, point.y - [COLOR=#098658]18[/COLOR], szText, dwFontColor );
                p2DRender->TextOut( point.x, point.y + [COLOR=#098658]12[/COLOR], szLevel, COLOR_MONSTER);

                [COLOR=#0000ff]if[/COLOR]( bShowHp )
                {
                    CSize hpLenght = p2DRender->m_pFont->GetTextExtent(szHealth);
                    p2DRender->TextOut( ( GetClientRect().Width() / [COLOR=#098658]2[/COLOR] ) - ( hpLenght.cx / [COLOR=#098658]2[/COLOR] ) , point.y - [COLOR=#098658]3[/COLOR], szHealth, [COLOR=#098658]0xf0ffffff[/COLOR]);
                }
                RenderMoverBuff( pMover, p2DRender );
                p2DRender->SetFont( pOldFont );
            }
        }
    }
    pObj = pWorld->GetObjFocus();

    [COLOR=#0000ff]if[/COLOR]( pObj && pObj->GetType() != OT_CTRL )
    {
        [COLOR=#0000ff]if[/COLOR]( !pObj->IsCull() )
        {
            [COLOR=#0000ff]if[/COLOR]( pObj == pWorld->GetObjFocus() )
            {
                CRect rectBound;
                GetBoundRect( pObj, &rectBound );
                RenderFocusObj( pObj, rectBound, D3DCOLOR_ARGB( [COLOR=#098658]100[/COLOR], [COLOR=#098658]255[/COLOR],  [COLOR=#098658]0[/COLOR],  [COLOR=#098658]0[/COLOR] ), [COLOR=#098658]0xffffff00[/COLOR] );
            }
        }
    }
    [COLOR=#0000ff]if[/COLOR]( m_bAutoAttack && m_pNextTargetObj && m_pNextTargetObj->GetType() != OT_CTRL )
    {
        [COLOR=#0000ff]if[/COLOR]( !m_pNextTargetObj->IsCull() )
        {
            [COLOR=#0000ff]if[/COLOR]( m_pNextTargetObj )
            {
                CRect rectBound;
                GetBoundRect( m_pNextTargetObj, &rectBound );
                RenderFocusObj( m_pNextTargetObj, rectBound, D3DCOLOR_ARGB( [COLOR=#098658]100[/COLOR], [COLOR=#098658]255[/COLOR],  [COLOR=#098658]0[/COLOR],  [COLOR=#098658]0[/COLOR] ), [COLOR=#098658]0xffffff00[/COLOR] );
            }
        }
    }
[COLOR=#0000ff]#if __VER [/COLOR]>=[COLOR=#098658]15[/COLOR][COLOR=#008000] // __GUILD_HOUSE[/COLOR]
    [COLOR=#0000ff]if[/COLOR]( IsValidObjID( GuildHouse->m_dwSelectedObjID ) )
    {
        CCtrl* pCtrl = prj.GetCtrl( GuildHouse->m_dwSelectedObjID );
        [COLOR=#0000ff]if[/COLOR]( pCtrl )
        {
            CRect recBound;
            GetBoundRect( pCtrl, &recBound );
            RenderFocusObj( pCtrl, recBound, D3DCOLOR_ARGB( [COLOR=#098658]100[/COLOR], [COLOR=#098658]255[/COLOR],  [COLOR=#098658]0[/COLOR],  [COLOR=#098658]0[/COLOR] ), [COLOR=#098658]0xffffff00[/COLOR] );
        }
    }
[COLOR=#0000ff]#endif[/COLOR][COLOR=#008000] //__GUILD_HOUSE[/COLOR]
}
[COLOR=#0000ff]#else[/COLOR][COLOR=#008000] //__NEW_TARGET[/COLOR]
[COLOR=#0000ff]void[/COLOR] CWndWorld::RenderSelectObj( C2DRender[COLOR=#0000ff]*[/COLOR] p2DRender, CObj[COLOR=#0000ff]*[/COLOR] pObj )
{
.....
}
[COLOR=#0000ff]#endif[/COLOR][COLOR=#008000] //__NEW_TARGET[/COLOR]
[/COLOR]
look up "m_texMsgIcon.LoadScript" and paste this below it :
Code:
[COLOR=#000000]    m_texMsgIcon.LoadScript( m_pApp->m_pd3dDevice, [COLOR=#a31515]"icon\\icon_IconMessenger.inc"[/COLOR] );
    m_texAttrIcon.LoadScript( m_pApp->m_pd3dDevice, [COLOR=#a31515]"icon\\Icon_MonElemantkind.inc"[/COLOR] );
[COLOR=#0000ff]#ifdef __NEW_TARGET[/COLOR]
    m_texJobIcon.LoadScript( m_pApp->m_pd3dDevice, [COLOR=#a31515]"icon\\Icon_JobClassTextures.inc"[/COLOR] );
[COLOR=#0000ff]#endif[/COLOR][COLOR=#008000] //__NEW_TARGET[/COLOR][/COLOR]
Inside "void CWndWorld::RenderMoverBuff" change the following :
Code:
[COLOR=#000000][COLOR=#0000ff]void[/COLOR] CWndWorld::RenderMoverBuff( CMover[COLOR=#0000ff]*[/COLOR] pMover, C2DRender [COLOR=#0000ff]*[/COLOR]p2DRender)
{
    [COLOR=#0000ff]if[/COLOR]( pMover == [COLOR=#0000ff]NULL[/COLOR] || p2DRender == [COLOR=#0000ff]NULL[/COLOR] )
        [COLOR=#0000ff]return[/COLOR];

    [COLOR=#0000ff]int[/COLOR] nIconSize = [COLOR=#098658]24[/COLOR];
    
[COLOR=#0000ff]#ifdef __NEW_TARGET[/COLOR]
    CPoint Lpoint = CPoint((GetClientRect().Width() - [COLOR=#098658]200[/COLOR]) / [COLOR=#098658]2[/COLOR] - [COLOR=#098658]23[/COLOR], [COLOR=#098658]64[/COLOR]);
[COLOR=#0000ff]#else[/COLOR][COLOR=#008000] //__NEW_TARGET[/COLOR]
    CPoint Lpoint = CPoint((GetClientRect().Width() - [COLOR=#098658]200[/COLOR]) / [COLOR=#098658]2[/COLOR] - [COLOR=#098658]20[/COLOR], [COLOR=#098658]44[/COLOR]);
[COLOR=#0000ff]#endif[/COLOR][COLOR=#008000] //__NEW_TARGET[/COLOR]
[/COLOR]

and also at the end :

Code:
[COLOR=#000000]                [COLOR=#0000ff]if[/COLOR]( bTime && pBuff->GetTotal() > [COLOR=#098658]0[/COLOR] )
                {
                    [COLOR=#0000ff]if[/COLOR]( dwOddTime > pBuff->GetTotal() )
                        g_toolTip.CancelToolTip();
                    [COLOR=#0000ff]else[/COLOR]
                        g_toolTip.PutToolTip( dwSkillID, strEdit, rectHittest, ptMouse, [COLOR=#098658]1[/COLOR] );
                }
                [COLOR=#0000ff]else[/COLOR]
                    g_toolTip.PutToolTip( dwSkillID, strEdit, rectHittest, ptMouse, [COLOR=#098658]1[/COLOR] );
                
                Count++;
                [COLOR=#0000ff]if[/COLOR]( (Count % [COLOR=#098658]8[/COLOR]) == [COLOR=#098658]0[/COLOR] )
                {
[COLOR=#0000ff]#ifdef __NEW_TARGET[/COLOR]
                    Lpoint.x = ( GetClientRect().Width() - [COLOR=#098658]200[/COLOR] ) / [COLOR=#098658]2[/COLOR] - [COLOR=#098658]23[/COLOR];
[COLOR=#0000ff]#else[/COLOR][COLOR=#008000] //__NEW_TARGET[/COLOR]
                    Lpoint.x = ( GetClientRect().Width() - [COLOR=#098658]200[/COLOR] ) / [COLOR=#098658]2[/COLOR] - [COLOR=#098658]20[/COLOR];
[COLOR=#0000ff]#endif[/COLOR][COLOR=#008000] //__NEW_TARGET[/COLOR]
                    Lpoint.y += nIconSize;
                }
[/COLOR]


WndWorld.h
Lookup "CTexturePack m_texAttrIcon" and paste this below :
Code:
[COLOR=#000000]    CTexturePack    m_texAttrIcon;
[COLOR=#0000ff]#ifdef __NEW_TARGET[/COLOR]
    CTexturePack    m_texJobIcon;
[COLOR=#0000ff]#endif[/COLOR][COLOR=#008000] //__NEW_TARGET[/COLOR]
[/COLOR]
 
Inactive
Joined
Jan 20, 2009
Messages
1,015
Reaction score
1,830
Approved, not sure why this thread got stuck in moderation for.

Thanks for the release and i even added in to the release index.
 
Junior Spellweaver
Joined
Sep 29, 2021
Messages
133
Reaction score
26
Thankyou so much, works great. Really like the tooltip
 
Back
Top