mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[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:
parent
8e84b0ff71
commit
f552049968
8 changed files with 39 additions and 44 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue