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

Healing Damager

xTremoxx

domasturb(cid, genital)
Joined
Aug 11, 2007
Messages
418
Reaction score
6
Location
Brazil
Hi iam searching for Show healing damage, in forgotten server have (trunk), have a code for i put in tags 0.2?
 
Hello!
Test it please

In configmanager.cpp

Under THIS:

Code:
m_confString[REPLACE_KICK_ON_LOGIN] = getGlobalString(L, "replaceKickOnLogin", "yes");

PASTE THIS:

Code:
m_confString[SHOW_HEALING_DAMAGE] = getGlobalString(L, "showHealingDamage", "no");


In configmanager.h
Under this:
Code:
REPLACE_KICK_ON_LOGIN,
PASTE THIS:

Code:
SHOW_HEALING_DAMAGE,

In game.cpp

In
Code:
 bool Game::combatChangeHealth
UNDER THIS:
Code:
target->gainHealth(attacker, healthChange);

PASTE THIS:
Code:
if(g_config.getString(ConfigManager::SHOW_HEALING_DAMAGE) == "yes")
        {
            const SpectatorVec& list = getSpectators(targetPos);
            char buffer[10];
            sprintf(buffer, "+%d", healthChange);
            if(combatType != COMBAT_HEALING)
                addMagicEffect(list, targetPos, NM_ME_MAGIC_ENERGY);
            addAnimatedText(list, targetPos, TEXTCOLOR_GREEN, buffer);
        }
 
Last edited:
C:\Forgotten\forgottenserver\tags\0.2\game.cpp In member function `bool Game::combatChangeHealth(CombatType_t, Creature*, Creature*, int32_t)':
3860 C:\Forgotten\forgottenserver\tags\0.2\game.cpp `TEXTCOLOR_GREEN' was not declared in this scope
C:\Forgotten\forgottenserver\tags\0.2\dev-cpp\Makefile.win [Build Error] [obj//game.o] Error 1

Give this error in hour i click for compile
 
it's work great on trunk but on tags im getting an issue i know the problem but idk how to fix it.... leme explain it's will buff the max that you can heal not how many you healed....


@Offtopic
Currently Active Users Moderators
Dark Warrior, Haizen, slawkens, Virgel

On c++ codes hope get help fast xd
 
The code works in tags like trunk works :D
:D:D:D:D

Fix for tags:

In creature.cpp under
Code:
void Creature::changeMana(int32_t manaChange)

Add
Code:
void Creature::gainHealth(Creature* caster, int32_t healthGain)
{
	if(healthGain > 0)
	{
		int32_t prevHealth = getHealth();
		changeHealth(healthGain);

		int32_t effectiveGain = getHealth() - prevHealth;
		if(caster)
			caster->onTargetCreatureGainHealth(this, effectiveGain);
	}
	else
		changeHealth(healthGain);
}

on creature.h under
Code:
virtual void changeMana(int32_t manaChange);
add
Code:
virtual void gainHealth(Creature* caster, int32_t healthGain);

And on game.cpp change
Code:
target->changeHealth(healthChange);
to
Code:
		target->gainHealth(attacker, healthChange);
		{
            const SpectatorVec& list = getSpectators(targetPos);
            char buffer[10];
            sprintf(buffer, "+%d", healthChange);
            if(combatType != COMBAT_HEALING)
                addMagicEffect(list, targetPos, NM_ME_MAGIC_ENERGY);
            addAnimatedText(list, targetPos, TEXTCOLOR_LIGHTGREEN, buffer);
        }

And done... without doing configmanager thingy :p
 
Back
Top