From e1e80271591214571d46d607a787877e9389bbc7 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 7 May 2022 15:05:30 -0400 Subject: [PATCH] Core/Auras: Implemented ProcFlags2 Port From (https://github.com/TrinityCore/TrinityCore/commit/7ff411013c9f6394161dbfdc07b3f3827b1de17f) --- Source/Game/Entities/Unit/Unit.Combat.cs | 14 +++++++++++++- Source/Game/Spells/Spell.cs | 2 ++ Source/Game/Spells/SpellEffects.cs | 2 ++ Source/Scripts/Spells/Rogue.cs | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Source/Game/Entities/Unit/Unit.Combat.cs b/Source/Game/Entities/Unit/Unit.Combat.cs index d7a4b93d3..320bb4ae7 100644 --- a/Source/Game/Entities/Unit/Unit.Combat.cs +++ b/Source/Game/Entities/Unit/Unit.Combat.cs @@ -797,8 +797,20 @@ namespace Game.Entities } if (!victim.IsCritter()) + { ProcSkillsAndAuras(attacker, victim, new ProcFlagsInit(ProcFlags.Kill), new ProcFlagsInit(ProcFlags.Killed), ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.None, ProcFlagsHit.None, null, null, null); - + if (player != null && player.GetGroup() != null) + { + for (GroupReference itr = player.GetGroup().GetFirstMember(); itr != null; itr = itr.Next()) + { + Player member = itr.GetSource(); + if (member != null) + if (member.IsAtGroupRewardDistance(victim)) + Unit.ProcSkillsAndAuras(member, victim, new ProcFlagsInit(ProcFlags.None, ProcFlags2.TargetDies), new ProcFlagsInit(ProcFlags.None), ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.None, ProcFlagsHit.None, null, null, null); + } + } + } + // Proc auras on death - must be before aura/combat remove ProcSkillsAndAuras(victim, victim, new ProcFlagsInit(ProcFlags.None), new ProcFlagsInit(ProcFlags.Death), ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.None, ProcFlagsHit.None, null, null, null); diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index b10c83823..d7538ab4c 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -2891,6 +2891,8 @@ namespace Game.Spells procAttacker = new ProcFlagsInit(IsPositive() ? ProcFlags.DoneSpellNoneDmgClassPos : ProcFlags.DoneSpellNoneDmgClassNeg); } + procAttacker.Or(ProcFlags2.CastSuccessful); + ProcFlagsHit hitMask = m_hitMask; if (!hitMask.HasAnyFlag(ProcFlagsHit.Critical)) hitMask |= ProcFlagsHit.Normal; diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index 272afeb56..da79441b3 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -3853,6 +3853,8 @@ namespace Game.Spells origin = new(m_caster.GetPosition()); unitTarget.KnockbackFrom(origin, speedxy, speedz); + + Unit.ProcSkillsAndAuras(GetUnitCasterForEffectHandlers(), unitTarget, new ProcFlagsInit(ProcFlags.None), new ProcFlagsInit(ProcFlags.None, ProcFlags2.Knockback), ProcFlagsSpellType.MaskAll, ProcFlagsSpellPhase.Hit, ProcFlagsHit.None, null, null, null); } [SpellEffectHandler(SpellEffectName.LeapBack)] diff --git a/Source/Scripts/Spells/Rogue.cs b/Source/Scripts/Spells/Rogue.cs index 16ea6a410..40a7a3116 100644 --- a/Source/Scripts/Spells/Rogue.cs +++ b/Source/Scripts/Spells/Rogue.cs @@ -203,7 +203,7 @@ namespace Scripts.Spells.Rogue continue; // Do not reproc deadly - if (spellInfo.SpellFamilyFlags == new FlagArray128(0x10000, 0x80000, 0, 0)) + if (spellInfo.SpellFamilyFlags & new FlagArray128(0x10000)) continue; if (spellInfo.IsPositive())