aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/master/2025_01_16_00_world.sql3
-rw-r--r--src/server/scripts/Spells/spell_dh.cpp26
2 files changed, 29 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_01_16_00_world.sql b/sql/updates/world/master/2025_01_16_00_world.sql
new file mode 100644
index 00000000000..fc76a3ffc4d
--- /dev/null
+++ b/sql/updates/world/master/2025_01_16_00_world.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dh_know_your_enemy';
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(388118, 'spell_dh_know_your_enemy');
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);