fix(Core/Spell): "Taming the Beast" hunter quests (#2243)

This commit is contained in:
Stoabrogga
2019-09-05 07:50:20 +02:00
committed by GitHub
parent a15c824abe
commit c5e187fed6
3 changed files with 74 additions and 1 deletions

View File

@@ -307,6 +307,35 @@ class spell_hun_generic_scaling : public SpellScriptLoader
}
};
// Taming the Beast quests (despawn creature after dismiss)
class spell_hun_taming_the_beast : public SpellScriptLoader
{
public:
spell_hun_taming_the_beast() : SpellScriptLoader("spell_hun_taming_the_beast") { }
class spell_hun_taming_the_beast_AuraScript : public AuraScript
{
PrepareAuraScript(spell_hun_taming_the_beast_AuraScript);
void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* target = GetTarget())
if (Creature* creature = target->ToCreature())
creature->DespawnOrUnsummon();
}
void Register()
{
OnEffectRemove += AuraEffectRemoveFn(spell_hun_taming_the_beast_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_MOD_CHARM, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const
{
return new spell_hun_taming_the_beast_AuraScript();
}
};
// Theirs
@@ -1180,6 +1209,7 @@ void AddSC_hunter_spell_scripts()
new spell_hun_wyvern_sting();
new spell_hun_animal_handler();
new spell_hun_generic_scaling();
new spell_hun_taming_the_beast();
// Theirs
new spell_hun_aspect_of_the_beast();