mcjc 4 Report post Posted March 3 (edited) 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 ); } Edited March 3 by mcjc Quote Share this post Link to post Share on other sites
Tenza 0 Report post Posted March 4 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; } Quote Share this post Link to post Share on other sites
mcjc 4 Report post Posted March 30 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. Quote Share this post Link to post Share on other sites
mcjc 4 Report post Posted March 31 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! Quote Share this post Link to post Share on other sites
Angelix 385 Report post Posted April 1 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. Quote Share this post Link to post Share on other sites
mcjc 4 Report post Posted April 1 2 hours ago, Angelix said: Something doesn't add up. What? Can someone who doesn't understand C++ write functional code? XD Quote Share this post Link to post Share on other sites
Tenza 0 Report post Posted April 1 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! Great Work! Quote Share this post Link to post Share on other sites
Angelix 385 Report post Posted April 2 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". Quote Share this post Link to post Share on other sites
mcjc 4 Report post Posted April 4 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. Quote Share this post Link to post Share on other sites