• 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!

Show heal healing numbers in red or green

ForgottenNot

Member
Joined
Feb 10, 2023
Messages
192
Reaction score
19
Hello


I know that for mana it should be in thsi way
Lua:
int32_t realManaChange = targetPlayer->getMana();
targetPlayer->changeMana(manaChange);
realManaChange = targetPlayer->getMana() - realManaChange;
if (realManaChange > 0 && !targetPlayer->isInGhostMode()) {
addAnimatedText(fmt::format("+{:d}", realManaChange), targetPlayer->getPosition(), TEXTCOLOR_WHITE);
}

the thing is that for heal the hing is a bit different

Code:
    int32_t realHealthChange = target->getHealth();
        target->gainHealth(attacker, damage.primary.value);
        realHealthChange = target->getHealth() - realHealthChange;

        if (realHealthChange > 0 && !target->isInGhostMode()) {
            auto damageString = fmt::format("{:d} hitpoint{:s}", realHealthChange, realHealthChange != 1 ? "s" : "");

i tried something like this:
Code:
auto damageString = addAnimatedText(fmt::format("+{:d}", realHealthChange, realHealthChange != 1 ? "s" : ""), targetPlayer->getPosition(), TEXTCOLOR_PASTELRED);
it wont compile, ideas please?
 
Last edited:
Back
Top