mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
fix(Core/Pets) Pet scaling only being applied to pets with DB Entry (#16401)
This commit is contained in:
@@ -1091,7 +1091,17 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(creature_ID, petlevel);
|
||||
if (pInfo) // exist in DB
|
||||
{
|
||||
SetCreateHealth(pInfo->health);
|
||||
// Default scale value of 1 to use if Pet.RankMod.Health = 0
|
||||
float factorHealth = 1;
|
||||
// If config is set to allow pets to use health modifiers, apply it to creatures with a DB entry
|
||||
// Pet.RankMod.Health = 1 use the factor value based on the rank of the pet, most pets have a rank of 0 and so use
|
||||
// the Elite rank which is set as the default in Creature::_GetHealthMod(int32 Rank)
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH))
|
||||
{
|
||||
factorHealth *= _GetHealthMod(cinfo->rank);
|
||||
}
|
||||
|
||||
SetCreateHealth(pInfo->health*factorHealth);
|
||||
SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, (float)pInfo->health);
|
||||
if (petType != HUNTER_PET) //hunter pet use focus
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user