From a2dcceb4f21ebc8a067a558396c7770f8e7a4cef Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 1 Jan 2022 17:13:41 -0500 Subject: [PATCH] Core/Auras: Implemented ChangeSpec, ChangeTalent and ChangeGlyph interrupt flags Port From (https://github.com/TrinityCore/TrinityCore/commit/05037bd936756b8ae553d17fd920ad8316f27487) --- Source/Framework/Constants/Spells/SpellConst.cs | 6 +++--- Source/Game/Entities/Player/Player.Talents.cs | 5 +++++ Source/Game/Spells/SpellEffects.cs | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 34d0ef1db..00a70ff88 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -168,7 +168,7 @@ namespace Framework.Constants Ground = 0x08, Transform = 0x10, // NYI Jump = 0x20, - ChangeSpec = 0x40, // NYI + ChangeSpec = 0x40, AbandonVehicle = 0x80, // NYI StartOfEncounter = 0x100, // NYI EndOfEncounter = 0x200, // NYI @@ -176,8 +176,8 @@ namespace Framework.Constants EnteringInstance = 0x800, // NYI DuelEnd = 0x1000, // NYI LeaveArenaOrBattleground = 0x2000, // NYI - ChangeTalent = 0x4000, // NYI - ChangeGlyph = 0x8000, // NYI + ChangeTalent = 0x4000, + ChangeGlyph = 0x8000, SeamlessTransfer = 0x10000, // NYI WarModeLeave = 0x20000, // NYI TouchingGround = 0x40000, // NYI diff --git a/Source/Game/Entities/Player/Player.Talents.cs b/Source/Game/Entities/Player/Player.Talents.cs index 9b8e75eea..b10115110 100644 --- a/Source/Game/Entities/Player/Player.Talents.cs +++ b/Source/Game/Entities/Player/Player.Talents.cs @@ -79,6 +79,9 @@ namespace Game.Entities else GetTalentMap(spec)[talent.Id] = learning ? PlayerSpellState.New : PlayerSpellState.Unchanged; + if (learning) + RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.ChangeTalent); + return true; } @@ -273,6 +276,8 @@ namespace Game.Entities ExitVehicle(); RemoveAllControlled(); + RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.ChangeSpec); + // remove single target auras at other targets var scAuras = GetSingleCastAuras(); foreach (var aura in scAuras) diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index e5d5e3744..9b20ef478 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -3076,6 +3076,8 @@ namespace Game.Spells else if (glyphId != 0) glyphs.Add(glyphId); + player.RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags2.ChangeGlyph); + GlyphPropertiesRecord glyphProperties = CliDB.GlyphPropertiesStorage.LookupByKey(glyphId); if (glyphProperties != null) player.CastSpell(player, glyphProperties.SpellID, new CastSpellExtraArgs(TriggerCastFlags.FullMask).SetOriginalCastId(m_castId));