diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.cpp | 4 | ||||
-rwxr-xr-x | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 12 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 58 |
3 files changed, 61 insertions, 13 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e4967e8633d..974d862d07e 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6608,9 +6608,11 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { case 34477: // Misdirection { + if (!GetMisdirectionTarget()) + return false; triggered_spell_id = 35079; // 4 sec buff on self target = this; - return true; + break; } case 57870: // Glyph of Mend Pet { diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3def3892c9a..f7635f3fab5 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4948,18 +4948,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool } } break; - case SPELLFAMILY_HUNTER: - switch (GetId()) - { - case 34477: // Misdirection - if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) - target->SetReducedThreatPercent(0, 0); - break; - case 35079: // Misdirection proc - target->SetReducedThreatPercent(0, 0); - break; - } - break; case SPELLFAMILY_DEATHKNIGHT: // Summon Gargoyle (Dismiss Gargoyle at remove) if (GetId() == 61777) diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 855af75cd83..1d1e43d5c6d 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -560,6 +560,64 @@ class spell_hun_pet_carrion_feeder : public SpellScriptLoader } }; +// 34477 Misdirection +class spell_hun_misdirection : public SpellScriptLoader +{ + public: + spell_hun_misdirection() : SpellScriptLoader("spell_hun_misdirection") { } + + class spell_hun_misdirection_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_misdirection_AuraScript); + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + if (GetDuration()) + caster->SetReducedThreatPercent(0, 0); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_misdirection_AuraScript(); + } +}; + +// 35079 Misdirection proc +class spell_hun_misdirection_proc : public SpellScriptLoader +{ + public: + spell_hun_misdirection_proc() : SpellScriptLoader("spell_hun_misdirection_proc") { } + + class spell_hun_misdirection_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_misdirection_proc_AuraScript); + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetCaster()) + GetCaster()->SetReducedThreatPercent(0, 0); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_proc_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_misdirection_proc_AuraScript(); + } +}; + + void AddSC_hunter_spell_scripts() { new spell_hun_aspect_of_the_beast(); |