Core/Spells: Implemented SPELL_AURA_SUPPRESS_ITEM_PASSIVE_EFFECT_BY_SPELL_LABEL
Port From (https://github.com/TrinityCore/TrinityCore/commit/6e4a90d2749c7675eebbb3eb41cd50ecaab78b7e)
This commit is contained in:
@@ -3889,6 +3889,9 @@ namespace Game.Entities
|
||||
foreach (ItemEffectRecord effectData in pItem.GetEffects())
|
||||
{
|
||||
SpellInfo effectSpellInfo = Global.SpellMgr.GetSpellInfo((uint)effectData.SpellID, Difficulty.None);
|
||||
if (effectSpellInfo == null)
|
||||
continue;
|
||||
|
||||
// apply proc cooldown to equip auras if we have any
|
||||
if (effectData.TriggerType == ItemSpelltriggerType.OnEquip)
|
||||
{
|
||||
|
||||
@@ -1468,6 +1468,10 @@ namespace Game.Spells
|
||||
|
||||
bool CanBeAppliedOn(Unit target)
|
||||
{
|
||||
foreach (uint label in GetSpellInfo().Labels)
|
||||
if (target.HasAuraTypeWithMiscvalue(AuraType.SuppressItemPassiveEffectBySpellLabel, (int)label))
|
||||
return false;
|
||||
|
||||
// unit not in world or during remove from world
|
||||
if (!target.IsInWorld || target.IsDuringRemoveFromWorld())
|
||||
{
|
||||
|
||||
@@ -5772,6 +5772,22 @@ namespace Game.Spells
|
||||
|
||||
playerTarget.SendMovementSetCollisionHeight(playerTarget.GetCollisionHeight(), UpdateCollisionHeightReason.Force);
|
||||
}
|
||||
|
||||
[AuraEffectHandler(AuraType.SuppressItemPassiveEffectBySpellLabel)]
|
||||
void HandleSuppressItemPassiveEffectBySpellLabel(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||
{
|
||||
if (!mode.HasAnyFlag(AuraEffectHandleModes.Real))
|
||||
return;
|
||||
|
||||
List<Aura> suppressedAuras = new();
|
||||
foreach (var appliedAura in aurApp.GetTarget().GetOwnedAuras())
|
||||
if (appliedAura.Value.GetSpellInfo().HasLabel((uint)GetMiscValue()))
|
||||
suppressedAuras.Add(appliedAura.Value);
|
||||
|
||||
// Refresh applications
|
||||
foreach (Aura aura in suppressedAuras)
|
||||
aura.ApplyForTargets();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user