mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 07:22:02 -04:00
Core/StatSystem: Implemented mastery.
This commit is contained in:
@@ -488,6 +488,44 @@ void Player::UpdateAllCritPercentages()
|
||||
UpdateCritPercentage(RANGED_ATTACK);
|
||||
}
|
||||
|
||||
void Player::UpdateMastery()
|
||||
{
|
||||
if (!CanUseMastery())
|
||||
{
|
||||
SetFloatValue(PLAYER_MASTERY, 0.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
float value = GetTotalAuraModifier(SPELL_AURA_MASTERY);
|
||||
value += GetRatingBonusValue(CR_MASTERY);
|
||||
SetFloatValue(PLAYER_MASTERY, value);
|
||||
|
||||
TalentTabEntry const* talentTab = sTalentTabStore.LookupEntry(GetPrimaryTalentTree(GetActiveSpec()));
|
||||
if (!talentTab)
|
||||
return;
|
||||
|
||||
for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i)
|
||||
{
|
||||
if (!talentTab->MasterySpellId[i])
|
||||
continue;
|
||||
|
||||
if (Aura* aura = GetAura(talentTab->MasterySpellId[i]))
|
||||
{
|
||||
for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
|
||||
{
|
||||
if (!aura->HasEffect(j))
|
||||
continue;
|
||||
|
||||
float mult = aura->GetSpellInfo()->Effects[j].BonusMultiplier;
|
||||
if (G3D::fuzzyEq(mult, 0.0f))
|
||||
continue;
|
||||
|
||||
aura->GetEffect(j)->ChangeAmount(int32(value * aura->GetSpellInfo()->Effects[j].BonusMultiplier));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const float m_diminishing_k[MAX_CLASSES] =
|
||||
{
|
||||
0.9560f, // Warrior
|
||||
|
||||
Reference in New Issue
Block a user