• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

(OTXSERVER TFS1.2 BASSED)Look HP/Mana regeneration and percent on look

Liikuid

Spin Machine!
Joined
Jul 17, 2010
Messages
257
Reaction score
24
Location
Iquique, Chile
(Title too redundant lol)
Hello mates, this is my first post for C++ section. I saw a lot of post about "i want to see those attributes like health regeneration when i look" Then i've decided to explore about how to do, and works well. Here we go:

Item.cpp

above
C++:
            if (it.abilities->speed) {
                if (begin) {
                    begin = false;
                    s << " (";
                } else {
                    s << ", ";
                }

                s << "speed " << std::showpos << (it.abilities->speed >> 1) << std::noshowpos;
            }

add the next line:

C++:
if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->healthGain << std::noshowpos << " hp/s";
            }
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->manaGain << std::noshowpos << " mana/s";
            }
            if (it.abilities->statsPercent[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "hp " << std::showpos << it.abilities->statsPercent[STAT_MAXHITPOINTS] - 100 << std::noshowpos << "%";
            }
            if (it.abilities->statsPercent[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->statsPercent[STAT_MAXMANAPOINTS] - 100 << std::noshowpos << "%";
            }

Compile and test. This is the code and it works well, as I said at the beginning of this post.

Look:
36504

Sry for my bad english.

Thanks
 
Last edited:
(Title too redundant lol)
Hello mates, this is my first post for C++ section. I saw a lot of post about "i want to see those attributes like health regeneration when i look" Then i've decided to explore about how to do, and works well. Here we go:

Item.cpp

above
C++:
            if (it.abilities->speed) {
                if (begin) {
                    begin = false;
                    s << " (";
                } else {
                    s << ", ";
                }

                s << "speed " << std::showpos << (it.abilities->speed >> 1) << std::noshowpos;
            }

add the next line:

C++:
if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->healthGain << std::noshowpos << " hp/s";
            }
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->manaGain << std::noshowpos << " mana/s";
            }
            if (it.abilities->statsPercent[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "hp " << std::showpos << it.abilities->statsPercent[STAT_MAXHITPOINTS] - 100 << std::noshowpos << "%";
            }
            if (it.abilities->statsPercent[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->statsPercent[STAT_MAXMANAPOINTS] - 100 << std::noshowpos << "%";
            }

Compile and test. This is the code and it works well, as I said at the beginning of this post.

Look:
View attachment 36504

Sry for my bad english.

Thanks
Work for me :)
 
Last edited:
Also works on the latest TFS release from git hub as of this date

Improved it a little by adding the ticks/s, I also added the normal maxHit/ManaPoints instead of just the percent attribute:

item.cpp
C++:
            // Show maxHitPoints on item
            if (it.abilities->stats[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->stats[STAT_MAXHITPOINTS] << std::noshowpos;
            }
      
            // Show maxManaPoints on item
            if (it.abilities->stats[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->stats[STAT_MAXMANAPOINTS] << std::noshowpos;
            }
      
            // Show maxHitPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->statsPercent[STAT_MAXHITPOINTS] - 100 << std::noshowpos << "%";
            }
      
            // Show maxManaPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->statsPercent[STAT_MAXMANAPOINTS] - 100 << std::noshowpos << "%";
            }
      
            // Show healthGain/healthTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->healthGain << std::noshowpos << " hp/" << std::showpos << it.abilities->healthTicks / 1000 << std::noshowpos << "s";
            }
      
            // Show manaGain/manaTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->manaGain << std::noshowpos << " mp/" << std::showpos << it.abilities->manaTicks / 1000 << std::noshowpos << "s";
            }

There are 2 places this needs to be pasted, just search for "speed", you can post this either above or below depending on where you want speed to show up on the item; before or after.

If someone can check the code for potential errors that would be great, as to ensure people do not ruin their distros.
Personally I haven't found any problems with it, yet.
 
Last edited:
Also works on the latest TFS release from git hub as of this date

Improved it a little by adding the ticks/s, I also added the normal maxHit/ManaPoints instead of just the percent attribute:

item.cpp
C++:
            // Show maxHitPoints on item
            if (it.abilities->stats[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->stats[STAT_MAXHITPOINTS] << std::noshowpos;
            }
     
            // Show maxManaPoints on item
            if (it.abilities->stats[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->stats[STAT_MAXMANAPOINTS] << std::noshowpos;
            }
     
            // Show maxHitPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->statsPercent[STAT_MAXHITPOINTS] - 100 << std::noshowpos << "%";
            }
     
            // Show maxManaPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->statsPercent[STAT_MAXMANAPOINTS] - 100 << std::noshowpos << "%";
            }
     
            // Show healthGain/healthTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->healthGain << std::noshowpos << " hp/" << std::showpos << it.abilities->healthTicks / 1000 << std::noshowpos << "s";
            }
     
            // Show manaGain/manaTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->manaGain << std::noshowpos << " mp/" << std::showpos << it.abilities->manaTicks / 1000 << std::noshowpos << "s";
            }

There are 2 places this needs to be pasted, just search for "speed", you can post this either above or below depending on where you want speed to show up on the item; before or after.

If someone can check the code for potential errors that would be great, as to ensure people do not ruin their distros.
Personally I haven't found any problems with it, yet.
I'm using the code below, but when it ONLY has mana/hp regen one is zeroed as shown in the image. do you have any solution to fix the code?
C++:
            // inicio
            // Show healthGain/healthTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << std::showpos << it.abilities->healthGain << std::noshowpos << " hp/" << it.abilities->healthTicks / 1000 << std::noshowpos << "s";
            }
            // Show manaGain/manaTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << std::showpos << it.abilities->manaGain << std::noshowpos << " mp/" << it.abilities->manaTicks / 1000 << std::noshowpos << "s";
            }
            //fim


Screenshot_22.png
 
Also works on the latest TFS release from git hub as of this date

Improved it a little by adding the ticks/s, I also added the normal maxHit/ManaPoints instead of just the percent attribute:

item.cpp
C++:
            // Show maxHitPoints on item
            if (it.abilities->stats[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->stats[STAT_MAXHITPOINTS] << std::noshowpos;
            }
     
            // Show maxManaPoints on item
            if (it.abilities->stats[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->stats[STAT_MAXMANAPOINTS] << std::noshowpos;
            }
     
            // Show maxHitPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->statsPercent[STAT_MAXHITPOINTS] - 100 << std::noshowpos << "%";
            }
     
            // Show maxManaPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->statsPercent[STAT_MAXMANAPOINTS] - 100 << std::noshowpos << "%";
            }
     
            // Show healthGain/healthTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->healthGain << std::noshowpos << " hp/" << std::showpos << it.abilities->healthTicks / 1000 << std::noshowpos << "s";
            }
     
            // Show manaGain/manaTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->manaGain << std::noshowpos << " mp/" << std::showpos << it.abilities->manaTicks / 1000 << std::noshowpos << "s";
            }

There are 2 places this needs to be pasted, just search for "speed", you can post this either above or below depending on where you want speed to show up on the item; before or after.

If someone can check the code for potential errors that would be great, as to ensure people do not ruin their distros.
Personally I haven't found any problems with it, yet.
convert canary?
Post automatically merged:

Also works on the latest TFS release from git hub as of this date

Improved it a little by adding the ticks/s, I also added the normal maxHit/ManaPoints instead of just the percent attribute:

item.cpp
C++:
            // Show maxHitPoints on item
            if (it.abilities->stats[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->stats[STAT_MAXHITPOINTS] << std::noshowpos;
            }
     
            // Show maxManaPoints on item
            if (it.abilities->stats[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->stats[STAT_MAXMANAPOINTS] << std::noshowpos;
            }
     
            // Show maxHitPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->statsPercent[STAT_MAXHITPOINTS] - 100 << std::noshowpos << "%";
            }
     
            // Show maxManaPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->statsPercent[STAT_MAXMANAPOINTS] - 100 << std::noshowpos << "%";
            }
     
            // Show healthGain/healthTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->healthGain << std::noshowpos << " hp/" << std::showpos << it.abilities->healthTicks / 1000 << std::noshowpos << "s";
            }
     
            // Show manaGain/manaTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->manaGain << std::noshowpos << " mp/" << std::showpos << it.abilities->manaTicks / 1000 << std::noshowpos << "s";
            }

There are 2 places this needs to be pasted, just search for "speed", you can post this either above or below depending on where you want speed to show up on the item; before or after.

If someone can check the code for potential errors that would be great, as to ensure people do not ruin their distros.
Personally I haven't found any problems with it, yet.
convert canary?
 
Also works on the latest TFS release from git hub as of this date

Improved it a little by adding the ticks/s, I also added the normal maxHit/ManaPoints instead of just the percent attribute:

item.cpp
C++:
            // Show maxHitPoints on item
            if (it.abilities->stats[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->stats[STAT_MAXHITPOINTS] << std::noshowpos;
            }
     
            // Show maxManaPoints on item
            if (it.abilities->stats[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->stats[STAT_MAXMANAPOINTS] << std::noshowpos;
            }
     
            // Show maxHitPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXHITPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "health " << std::showpos << it.abilities->statsPercent[STAT_MAXHITPOINTS] - 100 << std::noshowpos << "%";
            }
     
            // Show maxManaPointsPercent on item
            if (it.abilities->statsPercent[STAT_MAXMANAPOINTS]) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "mana " << std::showpos << it.abilities->statsPercent[STAT_MAXMANAPOINTS] - 100 << std::noshowpos << "%";
            }
     
            // Show healthGain/healthTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->healthGain << std::noshowpos << " hp/" << std::showpos << it.abilities->healthTicks / 1000 << std::noshowpos << "s";
            }
     
            // Show manaGain/manaTicks on item
            if (it.abilities->regeneration) {
                if (begin) {
                    begin = false;
                    s << " (";
                }
                else {
                    s << ", ";
                }

                s << "+" << std::showpos << it.abilities->manaGain << std::noshowpos << " mp/" << std::showpos << it.abilities->manaTicks / 1000 << std::noshowpos << "s";
            }

There are 2 places this needs to be pasted, just search for "speed", you can post this either above or below depending on where you want speed to show up on the item; before or after.

If someone can check the code for potential errors that would be great, as to ensure people do not ruin their distros.
Personally I haven't found any problems with it, yet.
Good morning bro, I put it in my source and compiled it without problem, but the item didn't appear, what can I do? something register in the movements?
see the items.xml if it is correct or not please tell me.. i would like to have this system for my ot xD
Lua:
<item id="11793" name="test boots">
        <attribute key="weight" value="12800"/>
    <attribute key="armor" value="20"/>
    <attribute key="healthGain" value="800"/>
    <attribute key="healthTicks" value="1"/>
    <attribute key="manaGain" value="20"/>
    <attribute key="manaTicks" value="1200"/>
    <attribute key="showattributes" value="1" />
    <attribute key="slotType" value="feet"/>
</item>
 
Good morning bro, I put it in my source and compiled it without problem, but the item didn't appear, what can I do? something register in the movements?
see the items.xml if it is correct or not please tell me.. i would like to have this system for my ot xD
Lua:
<item id="11793" name="test boots">
        <attribute key="weight" value="12800"/>
    <attribute key="armor" value="20"/>
    <attribute key="healthGain" value="800"/>
    <attribute key="healthTicks" value="1"/>
    <attribute key="manaGain" value="20"/>
    <attribute key="manaTicks" value="1200"/>
    <attribute key="showattributes" value="1" />
    <attribute key="slotType" value="feet"/>
</item>
register is missing the item without movements
 
convert canary?
Post automatically merged:


convert canary?


Lua:
            if (itemType.abilities->getHealthGain() > 0) {
                if (begin) {
                    begin = false;
                    itemDescription << " (";
                } else {
                    itemDescription << ", ";
                }
                itemDescription << "+" << std::showpos << itemType.abilities->getHealthGain() << std::noshowpos << " hp/" << std::showpos << itemType.abilities->getHealthTicks() / 1000 << "s";
            }
       
            if (itemType.abilities->getManaGain() > 0) {
                if (begin) {
                    begin = false;
                    itemDescription << " (";
                } else {
                    itemDescription << ", ";
                }
                itemDescription << "+" << std::showpos << itemType.abilities->getManaGain() << std::noshowpos << " mana/" << std::showpos << itemType.abilities->getManaTicks() / 1000 << "s";
            }
1693953561106.png
 
Lua:
            if (itemType.abilities->getHealthGain() > 0) {
                if (begin) {
                    begin = false;
                    itemDescription << " (";
                } else {
                    itemDescription << ", ";
                }
                itemDescription << "+" << std::showpos << itemType.abilities->getHealthGain() << std::noshowpos << " hp/" << std::showpos << itemType.abilities->getHealthTicks() / 1000 << "s";
            }
     
            if (itemType.abilities->getManaGain() > 0) {
                if (begin) {
                    begin = false;
                    itemDescription << " (";
                } else {
                    itemDescription << ", ";
                }
                itemDescription << "+" << std::showpos << itemType.abilities->getManaGain() << std::noshowpos << " mana/" << std::showpos << itemType.abilities->getManaTicks() / 1000 << "s";
            }
View attachment 78169
is showing the triplicated attributes


 
Estou usando o código abaixo, mas quando ele SÓ tem regeneração de mana/hp um é zerado conforme mostrado na imagem. você tem alguma solução para corrigir o código?
C++:
 // inicio
            //Mostra healthGain/healthTicks no item
            if (it.abilities->regeneração) {
                se (começar) {
                    começar = falso;
                    s << " (";
                }
                outro {
                    s << ", ";
                }

                s << std::showpos << it.abilities->healthGain << std::noshowpos << " hp/" << it.abilities->healthTicks / 1000 << std::noshowpos << "s";
            }
            //Mostra manaGain/manaTicks no item
            if (it.abilities->regeneração) {
                se (começar) {
                    começar = falso;
                    s << " (";
                }
                outro {
                    s << ", ";
                }

                s << std::showpos << it.abilities->manaGain << std::noshowpos << " mp/" << it.abilities->manaTicks / 1000 << std::noshowpos << "s";
            }
            //fim


View attachment 61299
Did anyone get the fix?
 
Back
Top