diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index 15ba104da..e63fa4edb 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -107,8 +107,8 @@ DBCStorage sGtChanceToMeleeCritStore(GtChanceToMe DBCStorage sGtChanceToSpellCritBaseStore(GtChanceToSpellCritBasefmt); DBCStorage sGtChanceToSpellCritStore(GtChanceToSpellCritfmt); DBCStorage sGtOCTClassCombatRatingScalarStore(GtOCTClassCombatRatingScalarfmt); -//DBCStorage sGtOCTRegenHPStore(GtOCTRegenHPfmt); //DBCStorage sGtOCTRegenMPStore(GtOCTRegenMPfmt); -- not used currently +DBCStorage sGtOCTHpPerStaminaStore(GtOCTHpPerStaminafmt); DBCStorage sGtRegenMPPerSptStore(GtRegenMPPerSptfmt); DBCStorage sGtSpellScalingStore(GtSpellScalingfmt); DBCStorage sGtOCTBaseHPByClassStore(GtOCTBaseHPByClassfmt); @@ -517,7 +517,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtChanceToSpellCritStore, dbcPath,"gtChanceToSpellCrit.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTClassCombatRatingScalarStore,dbcPath,"gtOCTClassCombatRatingScalar.dbc"); - //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenHPStore, dbcPath,"gtOCTRegenHP.dbc"); + LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTHpPerStaminaStore, dbcPath,"gtOCTHpPerStamina.dbc"); //LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtOCTRegenMPStore, dbcPath,"gtOCTRegenMP.dbc"); -- not used currently LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtRegenMPPerSptStore, dbcPath,"gtRegenMPPerSpt.dbc"); LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGtSpellScalingStore, dbcPath,"gtSpellScaling.dbc"); // 15595 diff --git a/src/game/DBCStores.h b/src/game/DBCStores.h index 9e47c9fa4..f8588b5f4 100644 --- a/src/game/DBCStores.h +++ b/src/game/DBCStores.h @@ -143,8 +143,8 @@ extern DBCStorage sGtChanceToMeleeCritStore; extern DBCStorage sGtChanceToSpellCritBaseStore; extern DBCStorage sGtChanceToSpellCritStore; extern DBCStorage sGtOCTClassCombatRatingScalarStore; -//extern DBCStorage sGtOCTRegenHPStore; //extern DBCStorage sGtOCTRegenMPStore; -- not used currently +extern DBCStorage sGtOCTHpPerStaminaStore; extern DBCStorage sGtRegenMPPerSptStore; extern DBCStorage sGtSpellScalingStore; extern DBCStorage sGtOCTBaseHPByClassStore; diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 556cd9278..d54f75045 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -1046,22 +1046,11 @@ struct GtOCTClassCombatRatingScalarEntry float ratio; }; -/*struct GtOCTRegenHPEntry +struct GtOCTHpPerStaminaEntry { //uint32 level; float ratio; -};*/ - -//struct GtOCTRegenMPEntry -//{ -// float ratio; -//}; - -/*struct GtRegenHPPerSptEntry -{ - //uint32 level; - float ratio; -};*/ +}; struct GtRegenMPPerSptEntry { diff --git a/src/game/DBCfmt.h b/src/game/DBCfmt.h index 7e0797969..0712912db 100644 --- a/src/game/DBCfmt.h +++ b/src/game/DBCfmt.h @@ -61,8 +61,8 @@ const char GtChanceToMeleeCritfmt[]="xf"; const char GtChanceToSpellCritBasefmt[]="xf"; const char GtOCTClassCombatRatingScalarfmt[]="df"; const char GtChanceToSpellCritfmt[]="xf"; +const char GtOCTHpPerStaminafmt[]="df"; const char GtOCTRegenHPfmt[]="xf"; -//const char GtOCTRegenMPfmt[]="f"; const char GtRegenHPPerSptfmt[]="xf"; const char GtRegenMPPerSptfmt[]="xf"; const char GtSpellScalingfmt[]="df"; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 9222ee1b2..511e6966b 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -550,6 +550,7 @@ Player::Player(WorldSession* session): Unit(), m_mover(this), m_camera(this), m_ m_baseSpellPower = 0; m_baseFeralAP = 0; + m_baseHealthRegen = 0; m_baseManaRegen = 0; m_armorPenetrationPct = 0.0f; m_spellPenetrationItemMod = 0; @@ -2059,7 +2060,7 @@ void Player::RegenerateAll(uint32 diff) { // Not in combat or they have regeneration if (!isInCombat() || HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT) || - HasAuraType(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT) || IsPolymorphed()) + HasAuraType(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT) || IsPolymorphed() || m_baseHealthRegen) { RegenerateHealth(diff); if (!isInCombat() && !HasAuraType(SPELL_AURA_INTERRUPT_REGEN)) @@ -2204,23 +2205,32 @@ void Player::RegenerateHealth(uint32 diff) // normal regen case (maybe partly in combat case) else if (!isInCombat() || HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT)) { - addvalue = OCTRegenHPPerSpirit() * HealthIncreaseRate; + addvalue = HealthIncreaseRate; if (!isInCombat()) { + if (getLevel() < 15) + addvalue = 0.20f * GetMaxHealth() * addvalue / getLevel(); + else + addvalue = 0.015f * GetMaxHealth() * addvalue; + AuraList const& mModHealthRegenPct = GetAurasByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT); for (AuraList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i) addvalue *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f; + + addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * 2.0f / 5.0f; } else if (HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT)) addvalue *= GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT) / 100.0f; if (!IsStandState()) - addvalue *= 1.5; + addvalue *= 1.33f; } // always regeneration bonus (including combat) addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT); + addvalue += m_baseHealthRegen / 2.5f; + if (addvalue < 0) addvalue = 0; @@ -5237,27 +5247,6 @@ float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const return 0.0f; } -float Player::OCTRegenHPPerSpirit() -{ - //uint32 level = getLevel(); - //uint32 pclass = getClass(); - - //if (level>GT_MAX_LEVEL) level = GT_MAX_LEVEL; - - //GtOCTRegenHPEntry const *baseRatio = sGtOCTRegenHPStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1); - //GtRegenHPPerSptEntry const *moreRatio = sGtRegenHPPerSptStore.LookupEntry((pclass-1)*GT_MAX_LEVEL + level-1); - //if (baseRatio==NULL || moreRatio==NULL) - return 0.0f; - - // Formula from PaperDollFrame script - //float spirit = GetStat(STAT_SPIRIT); - //float baseSpirit = spirit; - //if (baseSpirit>50) baseSpirit = 50; - //float moreSpirit = spirit - baseSpirit; - //float regen = baseSpirit * baseRatio->ratio + moreSpirit * moreRatio->ratio; - //return regen; -} - float Player::OCTRegenMPPerSpirit() { uint32 level = getLevel(); @@ -7103,6 +7092,9 @@ void Player::_ApplyItemBonuses(ItemPrototype const* proto, uint8 slot, bool appl case ITEM_MOD_SPELL_POWER: ApplySpellPowerBonus(int32(val), apply); break; + case ITEM_MOD_HEALTH_REGEN: + ApplyHealthRegenBonus(int32(val), apply); + break; case ITEM_MOD_SPELL_PENETRATION: ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, -int32(val), apply); m_spellPenetrationItemMod += apply ? val : -val; @@ -12535,6 +12527,10 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ApplySpellPowerBonus(enchant_amount, apply); DEBUG_LOG("+ %u SPELL_POWER", enchant_amount); break; + case ITEM_MOD_HEALTH_REGEN: + ApplyHealthRegenBonus(enchant_amount, apply); + DEBUG_LOG("+ %u HEALTH_REGENERATION", enchant_amount); + break; case ITEM_MOD_SPELL_PENETRATION: ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, -int32(enchant_amount), apply); m_spellPenetrationItemMod += apply ? enchant_amount : -int32(enchant_amount); diff --git a/src/game/Player.h b/src/game/Player.h index 0ab8e835f..1bc65f8aa 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1821,7 +1821,6 @@ class MANGOS_DLL_SPEC Player : public Unit float GetMeleeCritFromAgility(); void GetDodgeFromAgility(float& diminishing, float& nondiminishing); float GetSpellCritFromIntellect(); - float OCTRegenHPPerSpirit(); float OCTRegenMPPerSpirit(); float GetRatingMultiplier(CombatRating cr) const; float GetRatingBonusValue(CombatRating cr) const; @@ -1842,6 +1841,7 @@ class MANGOS_DLL_SPEC Player : public Unit void UpdateExpertise(WeaponAttackType attType); void UpdateArmorPenetration(); void ApplyManaRegenBonus(int32 amount, bool apply); + void ApplyHealthRegenBonus(int32 amount, bool apply); void UpdateManaRegen(); void UpdateMasteryAuras(); @@ -2534,6 +2534,7 @@ class MANGOS_DLL_SPEC Player : public Unit uint16 m_baseSpellPower; uint16 m_baseFeralAP; uint16 m_baseManaRegen; + uint32 m_baseHealthRegen; float m_armorPenetrationPct; int32 m_spellPenetrationItemMod; diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index f8c592d76..9dc4d91d6 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -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); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5dc738a75..bd9295265 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12198" + #define REVISION_NR "12199" #endif // __REVISION_NR_H__