From 0e8d21bae9ea45194efa5ef6fdddce722f5d1f4e Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 23 Jun 2021 13:25:19 -0400 Subject: [PATCH] Core/Auras: Don't remove shield only dependant auras on disarm Port From (https://github.com/TrinityCore/TrinityCore/commit/) --- Source/Game/Entities/Player/Player.Spells.cs | 23 +++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Source/Game/Entities/Player/Player.Spells.cs b/Source/Game/Entities/Player/Player.Spells.cs index 8911fb295..9c4eb2a2e 100644 --- a/Source/Game/Entities/Player/Player.Spells.cs +++ b/Source/Game/Entities/Player/Player.Spells.cs @@ -1700,6 +1700,23 @@ namespace Game.Entities { if (!spellInfo.HasAttribute(SpellAttr8.ArmorSpecialization)) { + // most used check: shield only + if ((spellInfo.EquippedItemSubClassMask & (1 << (int)ItemSubClassArmor.Shield)) != 0) + { + Item item = GetUseableItemByPos(InventorySlots.Bag0, EquipmentSlot.OffHand); + if (item != null) + if (item != ignoreItem && item.IsFitToSpellRequirements(spellInfo)) + return true; + + // special check to filter things like Shield Wall, the aura is not permanent and must stay even without required item + if (!spellInfo.IsPassive()) + { + foreach (SpellEffectInfo effect in spellInfo.GetEffects()) + if (effect != null && effect.IsAura()) + return true; + } + } + // tabard not have dependent spells for (byte i = EquipmentSlot.Start; i < EquipmentSlot.MainHand; ++i) { @@ -1708,12 +1725,6 @@ namespace Game.Entities if (item != ignoreItem && item.IsFitToSpellRequirements(spellInfo)) return true; } - - // shields can be equipped to offhand slot - Item item1 = GetUseableItemByPos(InventorySlots.Bag0, EquipmentSlot.OffHand); - if (item1) - if (item1 != ignoreItem && item1.IsFitToSpellRequirements(spellInfo)) - return true; } else {