• Congratulations to the OTLand January Mapping Competition Winner! The grand prize of Otland Premium goes to Andréew.
  • Sign up for February Mapping Competition! The prize includes Otland Premium time.
  • 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
241
Best answers
0
Reaction score
11
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:

115820

New Member
Joined
Feb 27, 2011
Messages
138
Best answers
1
Reaction score
0
(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:
Top