• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Regenerate Animation

krankthefunk

New Member
Joined
Jan 7, 2008
Messages
127
Reaction score
2
I would like to request a code that everytime a player regenerate health it will show in green color animation but not when you are at full health. Note this is not the same with Healing Combat that TFS already has. It just heal the ammount you set in vocation.xml with the healthticks. Using TFS 0.3 beta 3.

Edit: A code for random experience from each monsters, I tried to use random_range(low int, high int) but it was only declare for uint32_t. Can someone help me on this
 
Last edited:
I would like to request a code that everytime a player regenerate health it will show in green color animation but not when you are at full health. Note this is not the same with Healing Combat that TFS already has. It just heal the ammount you set in vocation.xml with the healthticks. Using TFS 0.3 beta 3.

Edit: A code for random experience from each monsters, I tried to use random_range(low int, high int) but it was only declare for uint32_t. Can someone help me on this

so you want all HEALTH ticks to show? not potions etc?
 
I would like to request a code that everytime a player regenerate health it will show in green color animation but not when you are at full health. Note this is not the same with Healing Combat that TFS already has. It just heal the ammount you set in vocation.xml with the healthticks. Using TFS 0.3 beta 3.

Edit: A code for random experience from each monsters, I tried to use random_range(low int, high int) but it was only declare for uint32_t. Can someone help me on this

in condition.cpp
search for
Code:
			creature->changeHealth(healthGain);
and after it add
PHP:
			Player* targetPlayer = creature->getPlayer();
			if(!creature->isInGhostMode() && targetPlayer && (targetPlayer->getMaxHealth() > targetPlayer->getHealth()))
			{
				char buffer[20];
				sprintf(buffer, "+%d", healthGain);

				const SpectatorVec& list = g_game.getSpectators(targetPlayer->getPosition());
				g_game.addAnimatedText(list, targetPlayer->getPosition(), TEXTCOLOR_LIGHTGREEN, buffer);
			}

i will look into your random EXP as well
 
For your random EXP in creatures.cpp
change
Code:
	uint64_t baseExperience = (uint64_t)std::floor(getDamageRatio(attacker) * getLostExperience());
to
PHP:
uint64_t baseExperience = (uint64_t)std::floor(getDamageRatio(attacker) * getLostExperience()) * ((rand() % 10) + 1);
with 10 being the upper limit and 1 being the lower limit
 
Back
Top