[12199] Fix health regeneration.

Author: @NorthStrider

Fix HP scaling from stamina. Author: @Subv
Fix HP regen bonus from items.

Signed-off-by: Yaki Khadafi <elsoldollo@gmail.com>
This commit is contained in:
Yaki Khadafi 2012-09-08 20:47:45 +03:00 committed by Antz
parent 8e84b0ff71
commit f552049968
8 changed files with 39 additions and 44 deletions

View file

@ -194,12 +194,16 @@ void Player::UpdateArmor()
float Player::GetHealthBonusFromStamina()
{
GtOCTHpPerStaminaEntry const* hpBase = sGtOCTHpPerStaminaStore.LookupEntry((getClass() - 1) * GT_MAX_LEVEL + getLevel() - 1);
float stamina = GetStat(STAT_STAMINA);
float baseStam = stamina < 20 ? stamina : 20;
float moreStam = stamina - baseStam;
if (moreStam < 0.0f)
moreStam = 0.0f;
return baseStam + (moreStam * 10.0f);
return baseStam + moreStam * hpBase->ratio;
}
float Player::GetManaBonusFromIntellect()
@ -741,6 +745,11 @@ void Player::ApplyManaRegenBonus(int32 amount, bool apply)
UpdateManaRegen();
}
void Player::ApplyHealthRegenBonus(int32 amount, bool apply)
{
m_baseHealthRegen += apply ? amount : -amount;
}
void Player::UpdateManaRegen()
{
float Intellect = GetStat(STAT_INTELLECT);