From 5d30388365fbb3cdb6f838f6f31b75e23a458d48 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 29 May 2022 15:38:35 -0400 Subject: [PATCH] Core/Spells: PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW applies only with invisibility type INVISIBILITY_GENERAL (0) Port From (https://github.com/TrinityCore/TrinityCore/commit/8ee432b1f03352345386201b99be1de19f043404) --- Source/Game/Spells/Auras/AuraEffect.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index 1eaebf17d..b163ae7bf 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -949,13 +949,13 @@ namespace Game.Spells return; Unit target = aurApp.GetTarget(); + Player playerTarget = target.ToPlayer(); InvisibilityType type = (InvisibilityType)GetMiscValue(); if (apply) { // apply glow vision - Player playerTarget = target.ToPlayer(); - if (playerTarget != null) + if (playerTarget != null && type == InvisibilityType.General) playerTarget.AddAuraVision(PlayerFieldByte2Flags.InvisibilityGlow); target.m_invisibility.AddFlag(type); @@ -966,8 +966,7 @@ namespace Game.Spells if (!target.HasAuraType(AuraType.ModInvisibility)) { // if not have different invisibility auras. - // remove glow vision - Player playerTarget = target.ToPlayer(); + // always remove glow vision if (playerTarget != null) playerTarget.RemoveAuraVision(PlayerFieldByte2Flags.InvisibilityGlow); @@ -986,7 +985,14 @@ namespace Game.Spells } } if (!found) + { + // if not have invisibility auras of type INVISIBILITY_GENERAL + // remove glow vision + if (playerTarget != null && type == InvisibilityType.General) + playerTarget.RemoveAuraVision(PlayerFieldByte2Flags.InvisibilityGlow); + target.m_invisibility.DelFlag(type); + } } target.m_invisibility.AddValue(type, -GetAmount());