Skip to content

Commit d646509

Browse files
committed
Core/Spells: Implement dh talent Retaliation
1 parent daac529 commit d646509

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dh_retaliation';
2+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
3+
(203819, 'spell_dh_retaliation');

src/server/scripts/Spells/spell_dh.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ enum DemonHunterSpells
171171
SPELL_DH_REPEAT_DECREE_CONDUIT = 339895,
172172
SPELL_DH_RESTLESS_HUNTER_TALENT = 390142,
173173
SPELL_DH_RESTLESS_HUNTER_BUFF = 390212,
174+
SPELL_DH_RETALIATION_TALENT = 389729,
175+
SPELL_DH_RETALIATION_PROC = 391160,
174176
SPELL_DH_SEVER = 235964,
175177
SPELL_DH_SHATTER_SOUL = 210038,
176178
SPELL_DH_SHATTER_SOUL_VENGEANCE_FRONT_RIGHT = 209980,
@@ -1669,6 +1671,40 @@ class spell_dh_restless_hunter : public AuraScript
16691671
}
16701672
};
16711673

1674+
// 389729 - Retaliation (attached to 203819 - Demon Spikes)
1675+
class spell_dh_retaliation : public AuraScript
1676+
{
1677+
bool Validate(SpellInfo const* /*spellInfo*/) override
1678+
{
1679+
return ValidateSpellInfo({ SPELL_DH_RETALIATION_TALENT, SPELL_DH_RETALIATION_PROC });
1680+
}
1681+
1682+
bool Load() override
1683+
{
1684+
return GetUnitOwner()->HasAura(SPELL_DH_RETALIATION_TALENT);
1685+
}
1686+
1687+
void HandleAfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
1688+
{
1689+
Unit* target = GetTarget();
1690+
target->CastSpell(target, SPELL_DH_RETALIATION_PROC, CastSpellExtraArgsInit{
1691+
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
1692+
.TriggeringAura = aurEff
1693+
});
1694+
}
1695+
1696+
void HandleAfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
1697+
{
1698+
GetTarget()->RemoveAurasDueToSpell(SPELL_DH_RETALIATION_PROC);
1699+
}
1700+
1701+
void Register() override
1702+
{
1703+
AfterEffectApply += AuraEffectApplyFn(spell_dh_retaliation::HandleAfterApply, EFFECT_0, SPELL_AURA_MOD_PARRY_PERCENT, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
1704+
AfterEffectRemove += AuraEffectRemoveFn(spell_dh_retaliation::HandleAfterRemove, EFFECT_0, SPELL_AURA_MOD_PARRY_PERCENT, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
1705+
}
1706+
};
1707+
16721708
// 388116 - Shattered Destiny
16731709
class spell_dh_shattered_destiny : public AuraScript
16741710
{
@@ -2114,6 +2150,7 @@ void AddSC_demon_hunter_spell_scripts()
21142150
RegisterSpellScript(spell_dh_monster_rising);
21152151
RegisterSpellScript(spell_dh_repeat_decree_conduit);
21162152
RegisterSpellScript(spell_dh_restless_hunter);
2153+
RegisterSpellScript(spell_dh_retaliation);
21172154
RegisterSpellScript(spell_dh_shattered_destiny);
21182155
RegisterSpellScriptWithArgs(spell_dh_shattered_souls, "spell_dh_shattered_souls_havoc", SPELL_DH_SHATTERED_SOULS_HAVOC);
21192156
RegisterSpellScriptWithArgs(spell_dh_shattered_souls, "spell_dh_shattered_souls_vengeance", SPELL_DH_SHATTER_SOUL);

0 commit comments

Comments
 (0)