From d07b57f93001a3de35e39698c5655c08f1eea512 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 1 Jun 2022 16:11:32 -0400 Subject: [PATCH] Core/Spells: Implemented SPELL_ATTR6_NO_PUSHBACK Port From (https://github.com/TrinityCore/TrinityCore/commit/50eff8c23828e4aa8dcce6c5f3ffdfa4e0cf7baa) --- Source/Framework/Constants/Spells/SpellConst.cs | 2 +- Source/Game/Entities/Unit/Unit.cs | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 5fe1578c2..51bb21df8 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1807,7 +1807,7 @@ namespace Framework.Constants AllowWhileRidingVehicle = 0x1000, // Allow While Riding Vehicle IgnorePhaseShift = 0x2000, // Ignore Phase Shift AiPrimaryRangedAttack = 0x4000, /*Nyi*/ // Ai Primary Ranged Attack - NoPushback = 0x8000, /*Nyi*/ // No Pushback + NoPushback = 0x8000, // No Pushback NoJumpPathing = 0x10000, /*Nyi*/ // No Jump Pathing AllowEquipWhileCasting = 0x20000, // Allow Equip While Casting OriginateFromController = 0x40000, // Originate From Controller Description Client Will Prevent Casting If Not Possessed, Charmer Will Be Caster For All Intents And Purposes diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index 87542d536..5b299efc9 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -2682,7 +2682,7 @@ namespace Game.Entities if (damagetype != DamageEffectType.NoDamage && damagetype != DamageEffectType.DOT) { - if (victim != attacker && (spellProto == null || !(spellProto.HasAttribute(SpellAttr7.NoPushbackOnDamage) || spellProto.HasAttribute(SpellAttr3.TreatAsPeriodic)))) + if (victim != attacker && (spellProto == null || !(spellProto.HasAttribute(SpellAttr6.NoPushback) || spellProto.HasAttribute(SpellAttr7.NoPushbackOnDamage) || spellProto.HasAttribute(SpellAttr3.TreatAsPeriodic)))) { Spell spell = victim.GetCurrentSpell(CurrentSpellTypes.Generic); if (spell != null) @@ -2723,15 +2723,14 @@ namespace Game.Entities spell.Delayed(); } } + } - if (damage != 0 && victim.IsPlayer()) - { - Spell spell1 = victim.GetCurrentSpell(CurrentSpellTypes.Channeled); - if (spell1 != null) - if (spell1.GetState() == SpellState.Casting && spell1.m_spellInfo.HasChannelInterruptFlag(SpellAuraInterruptFlags.DamageChannelDuration)) - spell1.DelayedChannel(); - } - + if (damage != 0 && victim.IsPlayer()) + { + Spell spell1 = victim.GetCurrentSpell(CurrentSpellTypes.Channeled); + if (spell1 != null) + if (spell1.GetState() == SpellState.Casting && spell1.m_spellInfo.HasChannelInterruptFlag(SpellAuraInterruptFlags.DamageChannelDuration)) + spell1.DelayedChannel(); } }