Scripts/Spells: Aspect of the Cheetah (#19755)

Closes #19611
This commit is contained in:
MartGon
2017-05-14 11:05:05 +02:00
committed by joschiwald
parent 8ea16ff923
commit 3e18fcb8fd
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
-- Hunter spell Aspect of the Cheetah (186257)
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_hun_aspect_cheetah';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(186257, 'spell_hun_aspect_cheetah');

View File

@@ -33,6 +33,7 @@
enum HunterSpells
{
SPELL_HUNTER_ASPECT_CHEETAH_SLOW = 186258,
SPELL_HUNTER_BESTIAL_WRATH = 19574,
SPELL_HUNTER_CHIMERA_SHOT_HEAL = 53353,
SPELL_HUNTER_EXHILARATION = 109304,
@@ -113,6 +114,42 @@ class spell_hun_ancient_hysteria : public SpellScriptLoader
}
};
// 186257 - Aspect of the Cheetah
class spell_hun_aspect_cheetah : public SpellScriptLoader
{
public:
spell_hun_aspect_cheetah() : SpellScriptLoader("spell_hun_aspect_cheetah") { }
class spell_hun_aspect_cheetah_AuraScript : public AuraScript
{
PrepareAuraScript(spell_hun_aspect_cheetah_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo
({
SPELL_HUNTER_ASPECT_CHEETAH_SLOW
});
}
void HandleOnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_ASPECT_CHEETAH_SLOW, true);
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_hun_aspect_cheetah_AuraScript::HandleOnRemove, EFFECT_0, SPELL_AURA_MOD_INCREASE_SPEED, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_hun_aspect_cheetah_AuraScript();
}
};
// 53209 - Chimera Shot
class spell_hun_chimera_shot : public SpellScriptLoader
{
@@ -1017,6 +1054,7 @@ class spell_hun_tnt : public SpellScriptLoader
void AddSC_hunter_spell_scripts()
{
new spell_hun_ancient_hysteria();
new spell_hun_aspect_cheetah();
new spell_hun_chimera_shot();
new spell_hun_cobra_shot();
new spell_hun_disengage();