fix(Core/Config): Added new config to make pet's health be modified b… (#14051)

This commit is contained in:
UltraNix
2023-02-11 04:08:28 +01:00
committed by GitHub
parent 2a29acac74
commit da70db415b
4 changed files with 16 additions and 0 deletions

View File

@@ -1108,6 +1108,11 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
float factorHealth = owner->GetTypeId() == TYPEID_PLAYER ? std::min(1.0f, cinfo->ModHealth) : cinfo->ModHealth;
float factorMana = owner->GetTypeId() == TYPEID_PLAYER ? std::min(1.0f, cinfo->ModMana) : cinfo->ModMana;
if (sWorld->getBoolConfig(CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH))
{
factorHealth *= _GetHealthMod(cinfo->rank);
}
SetCreateHealth(std::max<uint32>(1, stats->BaseHealth[cinfo->expansion]*factorHealth));
SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, GetCreateHealth());
SetCreateMana(stats->BaseMana * factorMana);