feature(Core/Pet): Add pet talent rate config (#17678)

* feat: add pet talent rate config

* feat(Core/Pet): keep consistent with player talent config

* refactor(Core/Pet): delete empty line
This commit is contained in:
forgives
2023-11-12 16:33:06 +08:00
committed by GitHub
parent bbadc32bea
commit ca7eb956aa
4 changed files with 15 additions and 1 deletions

View File

@@ -2045,6 +2045,13 @@ Rate.Damage.Fall = 1
Rate.Talent = 1
#
# Rate.Talent.Pet
# Description: Pet Talent point rate.
# Default: 1
Rate.Talent.Pet = 1
#
# Rate.Health
# Rate.Mana

View File

@@ -2240,7 +2240,7 @@ uint8 Pet::GetMaxTalentPointsForLevel(uint8 level)
sScriptMgr->OnCalculateMaxTalentPointsForLevel(this, level, points);
return points;
return uint8(points * sWorld->getRate(RATE_TALENT_PET));
}
void Pet::ToggleAutocast(SpellInfo const* spellInfo, bool apply)

View File

@@ -503,6 +503,7 @@ enum Rates
RATE_HONOR,
RATE_ARENA_POINTS,
RATE_TALENT,
RATE_TALENT_PET,
RATE_CORPSE_DECAY_LOOTED,
RATE_INSTANCE_RESET_TIME,
RATE_DURABILITY_LOSS_ON_DEATH,

View File

@@ -573,6 +573,12 @@ void World::LoadConfigSettings(bool reload)
LOG_ERROR("server.loading", "Rate.Talent ({}) must be > 0. Using 1 instead.", _rate_values[RATE_TALENT]);
_rate_values[RATE_TALENT] = 1.0f;
}
_rate_values[RATE_TALENT_PET] = sConfigMgr->GetOption<float>("Rate.Talent.Pet", 1.0f);
if (_rate_values[RATE_TALENT_PET] < 0.0f)
{
LOG_ERROR("server.loading", "Rate.Talent.Pet ({}) must be > 0. Using 1 instead.", _rate_values[RATE_TALENT_PET]);
_rate_values[RATE_TALENT_PET] = 1.0f;
}
_rate_values[RATE_MOVESPEED] = sConfigMgr->GetOption<float>("Rate.MoveSpeed", 1.0f);
if (_rate_values[RATE_MOVESPEED] < 0)
{