diff --git a/src/game/Entities/Creature.cpp b/src/game/Entities/Creature.cpp index fd6a940bda9..0004e7e842f 100644 --- a/src/game/Entities/Creature.cpp +++ b/src/game/Entities/Creature.cpp @@ -1319,7 +1319,7 @@ void Creature::SelectLevel(uint32 forcedLevel /*= USE_DEFAULT_DATABASE_LEVEL*/) float rangedAttackPwr = 0.f; float healthMultiplier = 1.f; - float manaMultiplier = 1.f; + float powerMultiplier = 1.f; float strength = 0.f; float agility = 0.f; @@ -1345,7 +1345,7 @@ void Creature::SelectLevel(uint32 forcedLevel /*= USE_DEFAULT_DATABASE_LEVEL*/) mana = cCLS->BaseMana; // mana if (cinfo->PowerMultiplier > 0) - manaMultiplier = cinfo->PowerMultiplier; + powerMultiplier = cinfo->PowerMultiplier; // armor if (cinfo->ArmorMultiplier >= 0) @@ -1443,7 +1443,6 @@ void Creature::SelectLevel(uint32 forcedLevel /*= USE_DEFAULT_DATABASE_LEVEL*/) // health SetCreateHealth(health); SetMaxHealth(health); - SetHealth(health); // all power types for (int i = POWER_MANA; i <= POWER_RUNIC_POWER; ++i) @@ -1469,7 +1468,6 @@ void Creature::SelectLevel(uint32 forcedLevel /*= USE_DEFAULT_DATABASE_LEVEL*/) // Mana requires an extra field to be set SetMaxPower(Powers(i), maxValue); - SetPower(Powers(i), value); if (i == POWER_MANA) SetCreateMana(value); @@ -1501,9 +1499,13 @@ void Creature::SelectLevel(uint32 forcedLevel /*= USE_DEFAULT_DATABASE_LEVEL*/) // multipliers SetModifierValue(UNIT_MOD_HEALTH, TOTAL_PCT, healthMultiplier); - SetModifierValue(UNIT_MOD_MANA, TOTAL_PCT, manaMultiplier); + SetModifierValue(UnitMods(UNIT_MOD_MANA + (int)GetPowerType()), TOTAL_PCT, powerMultiplier); UpdateAllStats(); + + SetHealth(GetMaxHealth()); + for (int i = POWER_MANA; i <= POWER_HAPPINESS; ++i) + SetPower(Powers(i), GetMaxPower(Powers(i))); } float Creature::_GetHealthMod(int32 Rank) diff --git a/src/game/Globals/ObjectMgr.cpp b/src/game/Globals/ObjectMgr.cpp index 227d5691648..34ba5c472de 100644 --- a/src/game/Globals/ObjectMgr.cpp +++ b/src/game/Globals/ObjectMgr.cpp @@ -1017,7 +1017,7 @@ CreatureClassLvlStats const* ObjectMgr::GetCreatureClassLvlStats(uint32 level, u CreatureClassLvlStats const* cCLS = &m_creatureClassLvlStats[level][classToIndex[unitClass]][expansion]; - if (cCLS->BaseHealth != 0 && cCLS->BaseDamage > 0.1f) + if ((cCLS->BaseHealth != 0 || cCLS->Stamina > 0) && cCLS->BaseDamage > 0.1f) return cCLS; return nullptr;