fix(Script/Spell): Gryphon/Wyvern Pet - Mounting Check Aura (#8481)

This commit is contained in:
Kitzunu
2021-11-25 13:31:55 +01:00
committed by GitHub
parent 26f1e3ffb8
commit 2ca0104b63
2 changed files with 37 additions and 0 deletions

View File

@@ -38,6 +38,7 @@
#include "SkillDiscovery.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "Unit.h"
#include "Vehicle.h"
#include <array>
@@ -2619,6 +2620,30 @@ class spell_gen_gnomish_transporter : public SpellScript
}
};
// 69641 - Gryphon/Wyvern Pet - Mounting Check Aura
class spell_gen_gryphon_wyvern_mount_check : public AuraScript
{
PrepareAuraScript(spell_gen_gryphon_wyvern_mount_check);
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
Unit* target = GetTarget();
Unit* owner = target->GetOwner();
if (!owner)
{
return;
}
target->SetDisableGravity(owner->IsMounted());
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_gryphon_wyvern_mount_check::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
enum DalaranDisguiseSpells
{
SPELL_SUNREAVER_DISGUISE_TRIGGER = 69672,
@@ -4419,6 +4444,7 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_spirit_healer_res);
RegisterSpellScript(spell_gen_gadgetzan_transporter_backfire);
RegisterSpellScript(spell_gen_gnomish_transporter);
RegisterSpellScript(spell_gen_gryphon_wyvern_mount_check);
RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_sunreaver_disguise");
RegisterSpellScriptWithArgs(spell_gen_dalaran_disguise, "spell_gen_silver_covenant_disguise");
RegisterSpellScript(spell_gen_elune_candle);