Jump to content

Recommended Posts







328589376_Capturadetela2025-03-03140608.png.345f4b6519586260acb08a9a3c03190e.png











image.png.f85b75eb9ca33da156e8953889fc66c3.pngimage.png.9e571d51b7f5c44904212d6062ea08ff.pngimage.png.17c48a5e6ce2c2e2a69a3ef45bfcb555.png

 

 

I give up, it doesn't work!
functions work correctly, but the &¨%$# of the icon does not work

I've been trying for days to make the icon change according to the item update, I've deleted the database, I've created a new account and I've made several changes to UIHeadSay.cpp Caracter.cpp

I've tried two other codes generated by AI, I've reset UIHeadSay and nothing works, nothing changes the player icon, it stays fixed, I give up on this.

Ximboliex sent me a simple but very functional code and it doesn't change the DOG at all!

I'm a beginner in programming, I'm learning on my own and he helps me but nothing works!

 

//Ximboliex Code

   if (_pHeadSay)
    {
        if (stPart.SLink[enumEQUIP_HEAD].sID == 9160)
        {
            _pHeadSay->SetIsShowEvil(1);
            if (stPart.SLink[enumEQUIP_HEAD].sEnergy[1] >= 5)
            {
                _pHeadSay->SetEvilLevel(5);
            }
            else
            {
                _pHeadSay->SetEvilLevel(stPart.SLink[enumEQUIP_HEAD].sEnergy[1]);
            }
        }
        else
        {
            _pHeadSay->SetIsShowEvil(0);
        }
    }
    RefreshItem( true );
}


//ME CODE 2

 

    if (_pHeadSay) {
        // Verifica se o ID do equipamento é 9160
        if (stPart.SLink[enumEQUIP_HEAD].sID == 9160) {
            _pHeadSay->SetIsShowEvil(1);  // Ativa a exibição do "Evil"
    
            // Obtém o valor da energia
            int energyValue = stPart.SLink[enumEQUIP_HEAD].sEnergy[1];
            
            // Verifica se o valor da energia é negativo, se for, define como 0
            if (energyValue < 0) energyValue = 0;
    
            // Define o nível de "Evil" com base no valor de energia progressivamente de 2 a 5
            int evilLevel = 0;
            
            if (energyValue >= 1 && energyValue < 2) {
                evilLevel = 2;
                stPart.SLink[enumEQUIP_HEAD].sEnergy[2] = 2;  // Ajusta a energia para 2
            } else if (energyValue >= 2 && energyValue < 3) {
                evilLevel = 3;
                stPart.SLink[enumEQUIP_HEAD].sEnergy[3] = 3;  // Ajusta a energia para 3
            } else if (energyValue >= 3 && energyValue < 4) {
                evilLevel = 4;
                stPart.SLink[enumEQUIP_HEAD].sEnergy[4] = 4;  // Ajusta a energia para 4
            } else if (energyValue >= 4) {
                evilLevel = 5;
                stPart.SLink[enumEQUIP_HEAD].sEnergy[5] = 5;  // Ajusta a energia para 5
            }
    
            // Define o nível de Evil
            _pHeadSay->SetEvilLevel(evilLevel);
        } else {
            _pHeadSay->SetIsShowEvil(0);
        }
    }
    RefreshItem( true );
}


//ME CODE  2 

    if (_pHeadSay) {
    // Verifica se o ID do equipamento é 9160
    if (stPart.SLink[enumEQUIP_HEAD].sID == 9160) {
        _pHeadSay->SetIsShowEvil(true);  // Ativa a exibição do "Evil"
        
        // Obtém o valor da energia
        int energyValue = stPart.SLink[enumEQUIP_HEAD].sEnergy[1];
        
        // Verifica se o valor da energia é negativo, se for, define como 0
        if (energyValue < 0) energyValue = 0;
        
        // Define o nível de "Evil" com base no valor de energia
        int evilLevel = 0;
        
        if (energyValue >= 1 && energyValue < 2) {
            evilLevel = 2;
            stPart.SLink[enumEQUIP_HEAD].sEnergy[2] = 2;  // Ajusta a energia para 2
        } else if (energyValue >= 2 && energyValue < 3) {
            evilLevel = 3;
            stPart.SLink[enumEQUIP_HEAD].sEnergy[3] = 3;  // Ajusta a energia para 3
        } else if (energyValue >= 3 && energyValue < 4) {
            evilLevel = 4;
            stPart.SLink[enumEQUIP_HEAD].sEnergy[4] = 4;  // Ajusta a energia para 4
        } else if (energyValue >= 4) {
            evilLevel = 5;
            stPart.SLink[enumEQUIP_HEAD].sEnergy[5] = 5;  // Ajusta a energia para 5
        }

        // Define o nível de Evil
        _pHeadSay->SetEvilLevel(evilLevel);  // Atualiza o nível de maldade após o upgrade
    } else {
        _pHeadSay->SetIsShowEvil(false);

        }
    }
    RefreshItem( true );
}



spacer.png

 

Edited by mcjc

Share this post


Link to post
Share on other sites

Give this a try :)
//Character.cpp   

 if (_pHeadSay)
    {
        if (stPart.SLink[enumEQUIP_HEAD].sID == 9160)
        {
            _pHeadSay->SetIsShowEvil(1);
            _pHeadSay->SetEvilLevel(stPart.SLink[enumEQUIP_HEAD].sEnergy[1]);
        }
        else
        {
            _pHeadSay->SetIsShowEvil(0);
        }
    }
    RefreshItem(true);
}
//UIHeadSay.cpp
-- bool CHeadSay::Init()

 

for (int i = 0; i < EVIL_MAX; i++)
{
    char buffer[64] = {0};
    sprintf(buffer, "texture/icon/evil_lv%d.png", i + 1);

    if (!_pImgEvil)
        break;

    _pImgEvil.LoadImage(buffer, 16, 16, 0, 0, 0, 0.0, 0.0);
}
--void CHeadSay::SetEvilLevel

void CHeadSay::SetEvilLevel(short sMaxEnergy)
{
    if (sMaxEnergy < 4)
    {
        _sEvilLevel = 0;
    }
    else if (sMaxEnergy == 4 || sMaxEnergy == 5)
    {
        _sEvilLevel = 1;
    }
    else if (sMaxEnergy == 6)
    {
        _sEvilLevel = 2;
    }
    else if (sMaxEnergy == 7)
    {
        _sEvilLevel = 3;
    }
    else if (sMaxEnergy == 8 || sMaxEnergy == 9 || sMaxEnergy == 10)
    {
        _sEvilLevel = 4;
    }
    else
    {
        _sEvilLevel = EVIL_MAX;
    }
}

void CHeadSay::SetIsShowEvil(bool bShow)
{
    _IsShowEvil = bShow;
}

 

Share this post


Link to post
Share on other sites
On 3/4/2025 at 6:20 AM, Tenza said:

Give this a try :)
//Character.cpp   

 if (_pHeadSay)
    {
        if (stPart.SLink[enumEQUIP_HEAD].sID == 9160)
        {
            _pHeadSay->SetIsShowEvil(1);
            _pHeadSay->SetEvilLevel(stPart.SLink[enumEQUIP_HEAD].sEnergy[1]);
        }
        else
        {
            _pHeadSay->SetIsShowEvil(0);
        }
    }
    RefreshItem(true);
}
//UIHeadSay.cpp
-- bool CHeadSay::Init()

 

for (int i = 0; i < EVIL_MAX; i++)
{
    char buffer[64] = {0};
    sprintf(buffer, "texture/icon/evil_lv%d.png", i + 1);

    if (!_pImgEvil)
        break;

    _pImgEvil.LoadImage(buffer, 16, 16, 0, 0, 0, 0.0, 0.0);
}
--void CHeadSay::SetEvilLevel

void CHeadSay::SetEvilLevel(short sMaxEnergy)
{
    if (sMaxEnergy < 4)
    {
        _sEvilLevel = 0;
    }
    else if (sMaxEnergy == 4 || sMaxEnergy == 5)
    {
        _sEvilLevel = 1;
    }
    else if (sMaxEnergy == 6)
    {
        _sEvilLevel = 2;
    }
    else if (sMaxEnergy == 7)
    {
        _sEvilLevel = 3;
    }
    else if (sMaxEnergy == 8 || sMaxEnergy == 9 || sMaxEnergy == 10)
    {
        _sEvilLevel = 4;
    }
    else
    {
        _sEvilLevel = EVIL_MAX;
    }
}

void CHeadSay::SetIsShowEvil(bool bShow)
{
    _IsShowEvil = bShow;
}

 

I just changed the entire code, the icon doesn't change, it stays the same! The equipment updates normally but the icon stays the same

check all the code, it's the same one I already have here.

 

evil.png

Share this post


Link to post
Share on other sites
On 3/4/2025 at 6:20 AM, Tenza said:

Give this a try :)
//Character.cpp   

 if (_pHeadSay)
    {
        if (stPart.SLink[enumEQUIP_HEAD].sID == 9160)
        {
            _pHeadSay->SetIsShowEvil(1);
            _pHeadSay->SetEvilLevel(stPart.SLink[enumEQUIP_HEAD].sEnergy[1]);
        }
        else
        {
            _pHeadSay->SetIsShowEvil(0);
        }
    }
    RefreshItem(true);
}
//UIHeadSay.cpp
-- bool CHeadSay::Init()

 

for (int i = 0; i < EVIL_MAX; i++)
{
    char buffer[64] = {0};
    sprintf(buffer, "texture/icon/evil_lv%d.png", i + 1);

    if (!_pImgEvil)
        break;

    _pImgEvil.LoadImage(buffer, 16, 16, 0, 0, 0, 0.0, 0.0);
}
--void CHeadSay::SetEvilLevel

void CHeadSay::SetEvilLevel(short sMaxEnergy)
{
    if (sMaxEnergy < 4)
    {
        _sEvilLevel = 0;
    }
    else if (sMaxEnergy == 4 || sMaxEnergy == 5)
    {
        _sEvilLevel = 1;
    }
    else if (sMaxEnergy == 6)
    {
        _sEvilLevel = 2;
    }
    else if (sMaxEnergy == 7)
    {
        _sEvilLevel = 3;
    }
    else if (sMaxEnergy == 8 || sMaxEnergy == 9 || sMaxEnergy == 10)
    {
        _sEvilLevel = 4;
    }
    else
    {
        _sEvilLevel = EVIL_MAX;
    }
}

void CHeadSay::SetIsShowEvil(bool bShow)
{
    _IsShowEvil = bShow;
}

 

I AM AWESOME!
I DID IT DAMN IT!!!!
MAN, I made several changes during this period and I came up with the definitive solution! It's not the same as the original, but it's very functional!
SUCK IT UP TO THOSE WHO DIDN'T WANT TO HELP AND IGNORED MY POSTS! I DID THIS WITHOUT ANYONE'S HELP!
THANK YOU ALSO TO EVERYONE WHO ENCOURAGED ME IN SOME WAY! AND THEY SENT ME SOME CODES UNTIL I COULD GET SOMETHING FUNCTIONAL!

Give me your discord, brother!

 

 

icon 1 lvl 3 .png

lvl 2 icon 1 .png

lvl 4 icon 2 .png

lvl 5 icon 2 .png

lvl 6 icon 3 .png

lvl 7 icon 4.png

lvl 8 icon 5 .png

lvl 9 icon 5.png

lvl 10 icon 5.png

Share this post


Link to post
Share on other sites
18 hours ago, mcjc said:

I AM AWESOME!
I DID IT DAMN IT!!!!
MAN, I made several changes during this period and I came up with the definitive solution! It's not the same as the original, but it's very functional!
SUCK IT UP TO THOSE WHO DIDN'T WANT TO HELP AND IGNORED MY POSTS! I DID THIS WITHOUT ANYONE'S HELP!
THANK YOU ALSO TO EVERYONE WHO ENCOURAGED ME IN SOME WAY! AND THEY SENT ME SOME CODES UNTIL I COULD GET SOMETHING FUNCTIONAL!

Give me your discord, brother!

Something doesn't add up. o.O

Share this post


Link to post
Share on other sites
2 hours ago, Angelix said:

Something doesn't add up. o.O

What?

Can someone who doesn't understand C++ write functional code?

XD

Share this post


Link to post
Share on other sites
On 3/31/2025 at 2:32 PM, mcjc said:

I AM AWESOME!
I DID IT DAMN IT!!!!
MAN, I made several changes during this period and I came up with the definitive solution! It's not the same as the original, but it's very functional!
SUCK IT UP TO THOSE WHO DIDN'T WANT TO HELP AND IGNORED MY POSTS! I DID THIS WITHOUT ANYONE'S HELP!
THANK YOU ALSO TO EVERYONE WHO ENCOURAGED ME IN SOME WAY! AND THEY SENT ME SOME CODES UNTIL I COULD GET SOMETHING FUNCTIONAL!

Give me your discord, brother!

 

 

icon 1 lvl 3 .png

lvl 2 icon 1 .png

lvl 4 icon 2 .png

lvl 5 icon 2 .png

lvl 6 icon 3 .png

lvl 7 icon 4.png

lvl 8 icon 5 .png

lvl 9 icon 5.png

lvl 10 icon 5.png

Great Work!

Share this post


Link to post
Share on other sites
On 3/31/2025 at 8:24 PM, mcjc said:

What?

Can someone who doesn't understand C++ write functional code?

XD

I'm not doubting you wrote it, but if you read what I highlighted, your reply would be different. You said "without anyone's help" and then right after said "they sent me some codes". If people helped you, please don't undervalue their work. Your post could've said "I finally got a functional code thanks to help from some community members".

Share this post


Link to post
Share on other sites
On 02/04/2025 at 02:11, Angelix said:

Não duvido que você tenha escrito, mas se você lesse o que eu destaquei, sua resposta seria diferente. Você disse "sem a ajuda de ninguém" e logo depois disse "eles me enviaram alguns códigos". Se as pessoas te ajudaram, por favor, não subestime o trabalho delas. Sua postagem poderia ter dito "Finalmente consegui um código funcional graças à ajuda de alguns membros da comunidade".

In fact, I managed to do it alone with a completely different code, but I said that at first no one wanted to help me! In fact, there were only two people who really tried to help me and I tagged them in other posts, the rest pretend that you don't even exist.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...