From ca55d131ac8497e75405a59043809a81bcbd0b5d Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 24 Sep 2022 13:57:38 -0400 Subject: [PATCH] Core/Spells: Fix glyph of stars (druid) Port From (https://github.com/TrinityCore/TrinityCore/commit/56ef6c06eb165e9410a1f0af8b54492ad99eeced) --- Source/Game/Entities/Unit/Unit.cs | 6 ++++ Source/Scripts/Spells/Druid.cs | 29 +++++++++++++++++++ ...22_09_19_00_world_druid_glyph_of_stars.sql | 3 ++ 3 files changed, 38 insertions(+) create mode 100644 sql/updates/world/master/2022_09_19_00_world_druid_glyph_of_stars.sql diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index 66382ea9c..b1ce7d736 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -1302,6 +1302,12 @@ namespace Game.Entities return 29414; case 35200: // Roc Form return 4877; + case 24858: // Moonkin Form + { + if (HasAura(114301)) // Glyph of Stars + return 0; + break; + } default: break; } diff --git a/Source/Scripts/Spells/Druid.cs b/Source/Scripts/Spells/Druid.cs index 8d79fa775..08dbd7372 100644 --- a/Source/Scripts/Spells/Druid.cs +++ b/Source/Scripts/Spells/Druid.cs @@ -62,6 +62,8 @@ namespace Scripts.Spells.Druid public const uint FormsTrinketNone = 37344; public const uint FormsTrinketTree = 37342; public const uint GalacticGuardianAura = 213708; + public const uint GlyphOfStars = 114301; + public const uint GlyphOfStarsVisual = 114302; public const uint GoreProc = 93622; public const uint IdolOfFeralShadows = 34241; public const uint IdolOfWorship = 60774; @@ -541,6 +543,33 @@ namespace Scripts.Spells.Druid } } + [Script] // 24858 - Moonkin Form + class spell_dru_glyph_of_stars : AuraScript + { + public override bool Validate(SpellInfo spell) + { + return ValidateSpellInfo(SpellIds.GlyphOfStars, SpellIds.GlyphOfStarsVisual); + } + + void OnApply(AuraEffect aurEff, AuraEffectHandleModes mode) + { + Unit target = GetTarget(); + if (target.HasAura(SpellIds.GlyphOfStars)) + target.CastSpell(target, SpellIds.GlyphOfStarsVisual, true); + } + + void OnRemove(AuraEffect aurEff, AuraEffectHandleModes mode) + { + GetTarget().RemoveAurasDueToSpell(SpellIds.GlyphOfStarsVisual); + } + + public override void Register() + { + OnEffectApply.Add(new EffectApplyHandler(OnApply, 1, AuraType.ModShapeshift, AuraEffectHandleModes.Real)); + OnEffectRemove.Add(new EffectApplyHandler(OnRemove, 1, AuraType.ModShapeshift, AuraEffectHandleModes.Real)); + } + } + [Script] // 210706 - Gore class spell_dru_gore : AuraScript { diff --git a/sql/updates/world/master/2022_09_19_00_world_druid_glyph_of_stars.sql b/sql/updates/world/master/2022_09_19_00_world_druid_glyph_of_stars.sql new file mode 100644 index 000000000..2b36c4fcb --- /dev/null +++ b/sql/updates/world/master/2022_09_19_00_world_druid_glyph_of_stars.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dru_glyph_of_stars'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(24858,'spell_dru_glyph_of_stars');