diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_dh.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_dh.cpp b/src/server/scripts/Spells/spell_dh.cpp index d1b4bb0687e..5c803d6e47d 100644 --- a/src/server/scripts/Spells/spell_dh.cpp +++ b/src/server/scripts/Spells/spell_dh.cpp @@ -899,6 +899,31 @@ struct at_dh_inner_demon : AreaTriggerAI } }; +// 388118 - Know Your Enemy +class spell_dh_know_your_enemy : public AuraScript +{ + void CalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool const& /*canBeRecalculated*/) const + { + if (AuraEffect const* amountHolder = GetEffect(EFFECT_1)) + { + float critChanceDone = GetUnitOwner()->GetUnitCriticalChanceDone(BASE_ATTACK); + amount = CalculatePct(critChanceDone, amountHolder->GetAmount()); + } + } + + void UpdatePeriodic(AuraEffect const* aurEff) const + { + if (AuraEffect* bonus = GetEffect(EFFECT_0)) + bonus->RecalculateAmount(aurEff); + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dh_know_your_enemy::CalcAmount, EFFECT_0, SPELL_AURA_MOD_CRIT_DAMAGE_BONUS); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_dh_know_your_enemy::UpdatePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY); + } +}; + // 209258 - Last Resort class spell_dh_last_resort : public AuraScript { @@ -1349,6 +1374,7 @@ void AddSC_demon_hunter_spell_scripts() RegisterSpellScript(spell_dh_furious_gaze); RegisterSpellScript(spell_dh_inner_demon); RegisterAreaTriggerAI(at_dh_inner_demon); + RegisterSpellScript(spell_dh_know_your_enemy); RegisterSpellScript(spell_dh_last_resort); RegisterSpellScript(spell_dh_restless_hunter); RegisterSpellScript(spell_dh_shattered_destiny); |