Core/Creatures: Implemented CREATURE_STATIC_FLAG_2_IGNORE_SANCTUARY (ignore SPELL_EFFECT_SANCTUARY, used by Vanish)

Port From (https://github.com/TrinityCore/TrinityCore/commit/1369b8708458fb5020b6ab7a9608123459d4eb26)
This commit is contained in:
hondacrx
2024-03-05 18:33:31 -05:00
parent 83bd8b255b
commit 536f72d077
6 changed files with 69 additions and 33 deletions
+14 -8
View File
@@ -55,23 +55,29 @@ namespace Game.Entities
public virtual void AtDisengage() { }
public void CombatStop(bool includingCast = false, bool mutualPvP = true)
public void CombatStop(bool includingCast = false, bool mutualPvP = true, Func<Unit, bool> unitFilter = null)
{
if (includingCast && IsNonMeleeSpellCast(false))
InterruptNonMeleeSpells(false);
AttackStop();
RemoveAllAttackers();
if (unitFilter == null)
RemoveAllAttackers();
else
{
List<Unit> attackersToRemove = attackerList.Where(unitFilter).ToList();
foreach (Unit attacker in attackersToRemove)
attacker.AttackStop();
}
if (IsTypeId(TypeId.Player))
ToPlayer().SendAttackSwingCancelAttack(); // melee and ranged forced attack cancel
m_combatManager.EndAllPvECombat(unitFilter);
if (mutualPvP)
ClearInCombat();
else
{ // vanish and brethren are weird
m_combatManager.EndAllPvECombat();
m_combatManager.SuppressPvPCombat();
}
m_combatManager.EndAllPvPCombat(unitFilter);
else // vanish and brethren are weird
m_combatManager.SuppressPvPCombat(unitFilter);
}
public void CombatStopWithPets(bool includingCast = false)