diff options
author | offl <11556157+offl@users.noreply.github.com> | 2021-09-27 00:41:25 +0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-03-17 23:59:01 +0100 |
commit | 5f40959687d78c6389a82c2f864cc8f60378dabb (patch) | |
tree | 20e6133d4e55553ac5a2edfde52bd65aca865dbb | |
parent | d763188887f97610251bc707047e57faf0ef57d3 (diff) |
Scripts/Spells: Mount check aura for Gryphon Hatchling & Wind Rider Cub (#26897)
Closes #26600
(cherry picked from commit 5f71c40b969c07f950e3dceb99037c7685512e71)
-rw-r--r-- | sql/updates/world/master/2022_03_17_06_world_2021_09_26_03_world.sql | 10 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 32 |
2 files changed, 42 insertions, 0 deletions
diff --git a/sql/updates/world/master/2022_03_17_06_world_2021_09_26_03_world.sql b/sql/updates/world/master/2022_03_17_06_world_2021_09_26_03_world.sql new file mode 100644 index 00000000000..9be7553cc9d --- /dev/null +++ b/sql/updates/world/master/2022_03_17_06_world_2021_09_26_03_world.sql @@ -0,0 +1,10 @@ +-- +UPDATE `creature_template` SET `unit_flags` = 768, `flags_extra` = `flags_extra`|512 WHERE `entry` IN (36908,36909); +DELETE FROM `creature_template_addon` WHERE `entry` IN (36908,36909); +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(36908,0,0,0,1,0,0,'69641'), +(36909,0,0,0,1,0,0,'69641'); + +DELETE FROM `spell_script_names` WHERE `spell_id` = 69641 AND `ScriptName` = 'spell_gen_gryphon_wyvern_mount_check'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(69641,'spell_gen_gryphon_wyvern_mount_check'); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 2b1178991d8..39703dc6376 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1843,6 +1843,37 @@ 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; + + if (owner->IsMounted()) + { + target->SetAnimTier(AnimTier::Fly); + target->SetDisableGravity(true); + } + else + { + target->SetAnimTier(AnimTier::Ground); + target->SetDisableGravity(false); + } + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_gryphon_wyvern_mount_check::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } +}; + enum Interrupt { SPELL_GEN_THROW_INTERRUPT = 32747 @@ -4831,6 +4862,7 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_gadgetzan_transporter_backfire); RegisterSpellScript(spell_gen_gift_of_naaru); RegisterSpellScript(spell_gen_gnomish_transporter); + RegisterSpellScript(spell_gen_gryphon_wyvern_mount_check); RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pal_blessing_of_kings"); RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_pal_blessing_of_might"); RegisterSpellScriptWithArgs(spell_gen_increase_stats_buff, "spell_dru_mark_of_the_wild"); |