diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-05-09 23:16:30 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-05-09 23:16:30 +0200 |
commit | 1325e0c4b279d590acbcbb05d6abdf5fdb66a882 (patch) | |
tree | e0c7e9db6f656fabce61eeba3b280c55e69436b5 /src/server/game/Entities/Pet | |
parent | 8828af2a5e3754e45893e0d62efae86747dfa4f2 (diff) |
Core/Units: Power handling improvements
* Don't include creature_template power multipliers in CreateMana updatefield
* Allow NPCs to have power types other than mana
* Add missing Essence config regeneration rate
* Fixed demon hunter powers not decaying immediately after combat
* Fixed some powers decaying immediately out of combat after energizing (for example holy power)
* Replace hardcoded list of powers to set to full on levelup with a db2 flag check
* Updated Creature::GetPowerIndex for 10.1 new power types
Diffstat (limited to 'src/server/game/Entities/Pet')
-rw-r--r-- | src/server/game/Entities/Pet/Pet.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index e95740ea408..5fc48d978ec 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -896,6 +896,8 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) SetStatFlatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(cinfo->resistance[i])); + Powers powerType = CalculateDisplayPowerType(); + // Health, Mana or Power, Armor PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(creature_ID, petlevel); if (pInfo) // exist in DB @@ -903,6 +905,8 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateHealth(pInfo->health); SetCreateMana(pInfo->mana); + SetStatPctModifier(UnitMods(UNIT_MOD_POWER_START + AsUnderlyingType(powerType)), BASE_PCT, 1.0f); + if (pInfo->armor > 0) SetStatFlatModifier(UNIT_MOD_ARMOR, BASE_VALUE, float(pInfo->armor)); @@ -916,7 +920,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) ApplyLevelScaling(); SetCreateHealth(sDB2Manager.EvaluateExpectedStat(ExpectedStatType::CreatureHealth, petlevel, cinfo->GetHealthScalingExpansion(), m_unitData->ContentTuningID, Classes(cinfo->unit_class)) * cinfo->ModHealth * cinfo->ModHealthExtra * _GetHealthMod(cinfo->rank)); - SetCreateMana(stats->GenerateMana(cinfo)); + SetCreateMana(stats->BaseMana); SetCreateStat(STAT_STRENGTH, 22); SetCreateStat(STAT_AGILITY, 22); SetCreateStat(STAT_STAMINA, 25); @@ -924,17 +928,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) } // Power - if (petType == HUNTER_PET) // Hunter pets have focus - SetPowerType(POWER_FOCUS); - else if (IsPetGhoul() || IsPetAbomination()) // DK pets have energy - { - SetPowerType(POWER_ENERGY); - SetFullPower(POWER_ENERGY); - } - else if (IsWarlockPet()) // Warlock pets have energy (since 5.x) - SetPowerType(POWER_ENERGY); - else - SetPowerType(POWER_MANA); + SetPowerType(powerType); // Damage SetBonusDamage(0); |