diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 19ae9aac1..cac0ec1a4 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -760,7 +760,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon) case SE_IncreaseRange: break; case SE_MaxHPChange: - newbon->MaxHP += base1; + newbon->MaxHPChange += base1; break; case SE_Packrat: newbon->Packrat += base1; diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index df056a757..0490b87d3 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -315,19 +315,13 @@ int32 Client::CalcHPRegenCap() int32 Client::CalcMaxHP() { - int64 nd = 10000; - int64 max_hp = (CalcBaseHP() + itembonuses.HP); - //The AA desc clearly says it only applies to base hp.. - //but the actual effect sent on live causes the client - //to apply it to (basehp + itemhp).. I will oblige to the client's whims over - //the aa description - nd += aabonuses.MaxHP; //Natural Durability, Physical Enhancement, Planar Durability - max_hp = max_hp * nd / 10000; //this is to fix the HP-above-495k issue + int32 base_hp = (CalcBaseHP() + itembonuses.HP); + int32 nd = aabonuses.MaxHPChange + spellbonuses.MaxHPChange + itembonuses.MaxHPChange; + max_hp = (base_hp * nd / 10000) + base_hp; + max_hp += GroupLeadershipAAHealthEnhancement(); max_hp += 5; max_hp += GetHeroicSTA() * 10; - max_hp += spellbonuses.HP + aabonuses.HP; - max_hp += GroupLeadershipAAHealthEnhancement(); - max_hp += max_hp * ((spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f); + max_hp += aabonuses.HP + spellbonuses.HP; if (current_hp > max_hp) { current_hp = max_hp; } @@ -340,8 +334,7 @@ int32 Client::CalcMaxHP() } } - this->max_hp = std::min(max_hp, (int64)std::numeric_limits::max()); - return this->max_hp; + return max_hp; } uint32 Mob::GetClassLevelFactor() diff --git a/zone/common.h b/zone/common.h index 772441025..86f37fc83 100644 --- a/zone/common.h +++ b/zone/common.h @@ -339,7 +339,6 @@ struct StatBonuses { int32 AC; int32 HP; int32 HPRegen; - int32 MaxHP; int32 ManaRegen; int32 EnduranceRegen; int32 Mana; diff --git a/zone/lua_stat_bonuses.cpp b/zone/lua_stat_bonuses.cpp index ef012c6d7..e113cf766 100644 --- a/zone/lua_stat_bonuses.cpp +++ b/zone/lua_stat_bonuses.cpp @@ -20,11 +20,6 @@ int32 Lua_StatBonuses::GetHPRegen() const { return self->HPRegen; } -int32 Lua_StatBonuses::GetMaxHP() const { - Lua_Safe_Call_Int(); - return self->MaxHP; -} - int32 Lua_StatBonuses::GetManaRegen() const { Lua_Safe_Call_Int(); return self->ManaRegen; @@ -1291,7 +1286,6 @@ luabind::scope lua_register_stat_bonuses() { .def("AC", &Lua_StatBonuses::GetAC) .def("HP", &Lua_StatBonuses::GetHP) .def("HPRegen", &Lua_StatBonuses::GetHPRegen) - .def("MaxHP", &Lua_StatBonuses::GetMaxHP) .def("ManaRegen", &Lua_StatBonuses::GetManaRegen) .def("EnduranceRegen", &Lua_StatBonuses::GetEnduranceRegen) .def("Mana", &Lua_StatBonuses::GetMana) diff --git a/zone/lua_stat_bonuses.h b/zone/lua_stat_bonuses.h index c65c589a4..912e9c5f6 100644 --- a/zone/lua_stat_bonuses.h +++ b/zone/lua_stat_bonuses.h @@ -28,7 +28,6 @@ public: int32 GetAC() const; int32 GetHP() const; int32 GetHPRegen() const; - int32 GetMaxHP() const; int32 GetManaRegen() const; int32 GetEnduranceRegen() const; int32 GetMana() const; diff --git a/zone/merc.cpp b/zone/merc.cpp index 2a68e8907..513e608d9 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -843,21 +843,13 @@ int32 Merc::CalcHPRegenCap() } int32 Merc::CalcMaxHP() { - float nd = 10000; - max_hp = (CalcBaseHP() + itembonuses.HP); - - //The AA desc clearly says it only applies to base hp.. - //but the actual effect sent on live causes the client - //to apply it to (basehp + itemhp).. I will oblige to the client's whims over - //the aa description - nd += aabonuses.MaxHP; //Natural Durability, Physical Enhancement, Planar Durability - - max_hp = (float)max_hp * (float)nd / (float)10000; //this is to fix the HP-above-495k issue - max_hp += spellbonuses.HP + aabonuses.HP; - + int32 base_hp = (CalcBaseHP() + itembonuses.HP); + int32 nd = aabonuses.MaxHPChange + spellbonuses.MaxHPChange + itembonuses.MaxHPChange; + max_hp = (base_hp * nd / 10000) + base_hp; max_hp += GroupLeadershipAAHealthEnhancement(); - - max_hp += max_hp * ((spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f); + max_hp += 5; + max_hp += GetHeroicSTA() * 10; + max_hp += aabonuses.HP + spellbonuses.HP; if (current_hp > max_hp) current_hp = max_hp;