mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Spells: Implement dh talent Critical Chaos (#30752)
This commit is contained in:
3
sql/updates/world/master/2025_08_21_00_world.sql
Normal file
3
sql/updates/world/master/2025_08_21_00_world.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dh_critical_chaos';
|
||||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
|
||||
(320413,'spell_dh_critical_chaos');
|
||||
@@ -534,6 +534,31 @@ class spell_dh_collective_anguish_eye_beam : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 320413 - Critical Chaos
|
||||
class spell_dh_critical_chaos : 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_critical_chaos::CalcAmount, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dh_critical_chaos::UpdatePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// Called by 198013 - Eye Beam
|
||||
class spell_dh_cycle_of_hatred : public SpellScript
|
||||
{
|
||||
@@ -1718,6 +1743,7 @@ void AddSC_demon_hunter_spell_scripts()
|
||||
RegisterSpellScript(spell_dh_chaos_theory_drop_charge);
|
||||
RegisterSpellScript(spell_dh_chaotic_transformation);
|
||||
RegisterSpellScript(spell_dh_charred_warblades);
|
||||
RegisterSpellScript(spell_dh_critical_chaos);
|
||||
RegisterSpellScript(spell_dh_collective_anguish);
|
||||
RegisterSpellScript(spell_dh_collective_anguish_eye_beam);
|
||||
RegisterSpellScript(spell_dh_cycle_of_hatred);
|
||||
|
||||
Reference in New Issue
Block a user