aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-02-21 16:07:01 +0100
committerShauren <shauren.trinity@gmail.com>2021-02-21 16:07:01 +0100
commitb811da080c1e2a73a8f7787716b5d51ed6e6b3b6 (patch)
tree14c3ac0c70c522c26114a56bd5edf844d7a6e48f /src
parentd2a995368459b28af0309292587a39f95fbf754c (diff)
Core/Auras: Implemented SPELL_AURA_MOD_COMBAT_RATING_FROM_COMBAT_RATING
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp17
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp2
2 files changed, 16 insertions, 3 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index e48e7cf392c..c58ade28662 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -5211,8 +5211,21 @@ void Player::ApplyRatingMod(CombatRating combatRating, int32 value, bool apply)
void Player::UpdateRating(CombatRating cr)
{
int32 amount = m_baseRatingValue[cr];
- AuraEffectList const& modRatingPct = GetAuraEffectsByType(SPELL_AURA_MOD_RATING_PCT);
- for (AuraEffect const* aurEff : modRatingPct)
+ for (AuraEffect const* aurEff : GetAuraEffectsByType(SPELL_AURA_MOD_COMBAT_RATING_FROM_COMBAT_RATING))
+ {
+ if (aurEff->GetMiscValueB() & (1 << cr))
+ {
+ Optional<int16> highestRating;
+ for (uint8 dependentRating = 0; dependentRating < MAX_COMBAT_RATING; ++dependentRating)
+ if (aurEff->GetMiscValue() & (1 << dependentRating))
+ highestRating = std::max(highestRating.value_or(m_baseRatingValue[dependentRating]), m_baseRatingValue[dependentRating]);
+
+ if (highestRating)
+ amount += int32(CalculatePct(*highestRating, aurEff->GetAmount()));
+ }
+ }
+
+ for (AuraEffect const* aurEff : GetAuraEffectsByType(SPELL_AURA_MOD_RATING_PCT))
if (aurEff->GetMiscValue() & (1 << cr))
amount += int32(CalculatePct(amount, aurEff->GetAmount()));
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 1d3d4cb2251..c21eb8514e1 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -266,7 +266,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleLearnSpell, //195 SPELL_AURA_LEARN_SPELL
&AuraEffect::HandleNULL, //196 SPELL_AURA_MOD_COOLDOWN - flat mod of spell cooldowns
&AuraEffect::HandleNoImmediateEffect, //197 SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE implemented in Unit::SpellCriticalBonus Unit::GetUnitCriticalChance
- &AuraEffect::HandleNULL, //198 SPELL_AURA_MOD_COMBAT_RATING_FROM_COMBAT_RATING
+ &AuraEffect::HandleNoImmediateEffect, //198 SPELL_AURA_MOD_COMBAT_RATING_FROM_COMBAT_RATING implemented in Player::UpdateRating
&AuraEffect::HandleUnused, //199 unused (4.3.4) old SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT
&AuraEffect::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::RewardPlayerAndGroupAtKill
&AuraEffect::HandleAuraAllowFlight, //201 SPELL_AURA_FLY this aura enable flight mode...