diff options
author | Kapoeira <vertozor@gmail.com> | 2011-08-30 20:24:36 +0700 |
---|---|---|
committer | tobmaps <spambot42@yandex.ru> | 2011-08-30 20:24:36 +0700 |
commit | 5d0a2b6094e0af1ba1ca2b30e36a0e22fac510cd (patch) | |
tree | f69d2d6360b0350409b2ea678041422aae6277cf /src/server/scripts/Spells | |
parent | aa85553bfd540084802d118ff6ef2062a88ed452 (diff) |
Core/Spells: Fix Aspect of the Beast
Closes #462
Closes #2814
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 19dd7f6c2e3..16d147a4000 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -39,6 +39,58 @@ enum HunterSpells HUNTER_SPELL_CHIMERA_SHOT_SERPENT = 53353, HUNTER_SPELL_CHIMERA_SHOT_VIPER = 53358, HUNTER_SPELL_CHIMERA_SHOT_SCORPID = 53359, + HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET = 61669, +}; + +// 13161 Aspect of the Beast +class spell_hun_aspect_of_the_beast : public SpellScriptLoader +{ +public: + spell_hun_aspect_of_the_beast() : SpellScriptLoader("spell_hun_aspect_of_the_beast") { } + + class spell_hun_aspect_of_the_beast_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_aspect_of_the_beast_AuraScript) + bool Validate(SpellInfo const* /*entry*/) + { + if (!sSpellMgr->GetSpellInfo(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET)) + return false; + return true; + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (!GetCaster()) + return; + + Unit* caster = GetCaster(); + if (caster->ToPlayer()) + if (Pet* pet = caster->ToPlayer()->GetPet()) + pet->RemoveAurasDueToSpell(HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET); + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (!GetCaster()) + return; + + Unit* caster = GetCaster(); + if (caster->ToPlayer()) + if (Pet* pet = caster->ToPlayer()->GetPet()) + caster->CastSpell(caster, HUNTER_SPELL_ASPECT_OF_THE_BEAST_PET, true); + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_hun_aspect_of_the_beast_AuraScript::OnApply, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_hun_aspect_of_the_beast_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_UNTRACKABLE, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript *GetAuraScript() const + { + return new spell_hun_aspect_of_the_beast_AuraScript(); + } }; // 53209 Chimera Shot @@ -512,6 +564,7 @@ public: void AddSC_hunter_spell_scripts() { + new spell_hun_aspect_of_the_beast(); new spell_hun_chimera_shot(); new spell_hun_invigoration(); new spell_hun_last_stand_pet(); |