diff options
author | Wyrserth <wyrserth@protonmail.com> | 2019-07-18 02:47:10 +0200 |
---|---|---|
committer | Wyrserth <wyrserth@protonmail.com> | 2019-07-18 02:47:58 +0200 |
commit | 55570be6610483da129e40291e49090a8bc0f30c (patch) | |
tree | 3730e9040c9a891ceb889293c99e646a43100d64 /src | |
parent | 5f5d2028df70e82d5cd70837953acd059f2ac7fb (diff) |
Core/Creature: honor existing DB data for health and mana in case of summoned pets that don't have pet-specific stat data.
Closes #23570.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Pet/Pet.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 68696f9a003..8f1f9f38381 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -872,9 +872,13 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) { // remove elite bonuses included in DB values CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(petlevel, cinfo->unit_class); - SetCreateHealth(stats->BaseHealth[cinfo->expansion]); - SetCreateMana(stats->BaseMana); + float healthmod = _GetHealthMod(cinfo->rank); + uint32 basehp = stats->GenerateHealth(cinfo); + uint32 health = uint32(basehp * healthmod); + uint32 mana = stats->GenerateMana(cinfo); + SetCreateHealth(health); + SetCreateMana(mana); SetCreateStat(STAT_STRENGTH, 22); SetCreateStat(STAT_AGILITY, 22); SetCreateStat(STAT_STAMINA, 25); |