aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Auras
diff options
context:
space:
mode:
authorOvahlord <dreadkiller@gmx.de>2024-08-21 14:55:19 +0200
committerOvahlord <dreadkiller@gmx.de>2024-08-21 14:55:19 +0200
commitb0e058e261caf55eec1f18eab2d79993930eb162 (patch)
tree68a12a7d0b61cf67928d9a3edc0a7126c03b8cc3 /src/server/game/Spells/Auras
parent675eb1bab2b129455a724c891804310ffeff26bf (diff)
Core/Player: restore crit chance bonus from intellect
* implemented SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL
Diffstat (limited to 'src/server/game/Spells/Auras')
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp19
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h1
2 files changed, 17 insertions, 3 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 90ec31a6411..acf008b281f 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -621,7 +621,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNULL, //549 formerly SPELL_AURA_46 - Ignore all gear test spells
&AuraEffect::HandleNULL, //550
&AuraEffect::HandleNULL, //551
- &AuraEffect::HandleNULL, //552
+ &AuraEffect::HandleModSpellCritChanceSchool, //552 SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL
&AuraEffect::HandleModPowerCost, //553 SPELL_AURA_MOD_POWER_COST_SCHOOL
&AuraEffect::HandleNULL, //554
&AuraEffect::HandleNULL, //555
@@ -4299,7 +4299,7 @@ void AuraEffect::HandleModSpellCritChance(AuraApplication const* aurApp, uint8 m
Unit* target = aurApp->GetTarget();
if (target->GetTypeId() == TYPEID_PLAYER)
- target->ToPlayer()->UpdateSpellCritChance();
+ target->ToPlayer()->UpdateAllCritPercentages();
else
target->m_baseSpellCritChance += apply ? GetAmount() : -GetAmount();
}
@@ -4320,7 +4320,20 @@ void AuraEffect::HandleAuraModCritPct(AuraApplication const* aurApp, uint8 mode,
target->ToPlayer()->UpdateAllWeaponDependentCritAuras();
// included in Player::UpdateSpellCritChance calculation
- target->ToPlayer()->UpdateSpellCritChance();
+ target->ToPlayer()->UpdateAllCritPercentages();
+}
+
+void AuraEffect::HandleModSpellCritChanceSchool(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
+{
+ if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
+ return;
+
+ Unit* target = aurApp->GetTarget();
+
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ for (uint8 i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
+ if (GetMiscValue() & (1 << i))
+ target->ToPlayer()->UpdateSpellCritChance(SpellSchools(i));
}
/********************************/
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 6d7f07256c7..1bb46abe8b8 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -274,6 +274,7 @@ class TC_GAME_API AuraEffect
void HandleModSpellHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleModSpellCritChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraModCritPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
+ void HandleModSpellCritChanceSchool(AuraApplication const* aurApp, uint8 mode, bool apply) const;
// attack speed
void HandleModCastingSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleModMeleeRangedSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;