From 3682957f4c8e96077da3acb95109ef0340d5aa57 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 15 Jun 2022 18:24:55 -0400 Subject: [PATCH] Core/Spells: Correct flagging spell caster for pvp when healing/buffing friendly creatures - it should only happen if target is in combat Port From (https://github.com/TrinityCore/TrinityCore/commit/84996901ccb22e2a82745d469f3560f7574a64c5) --- Source/Game/Spells/Spell.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index aadf1d7bd..8a688e820 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -8269,8 +8269,9 @@ namespace Game.Spells unit.SetInCombatWith(spell.GetCaster().ToPlayer()); // if target is flagged for pvp also flag caster if a player + // but respect current pvp rules (buffing/healing npcs flagged for pvp only flags you if they are in combat) _enablePVP = (MissCondition == SpellMissInfo.None || spell.m_spellInfo.HasAttribute(SpellAttr3.PvpEnabling)) - && unit.IsPvP() && spell.GetCaster().IsPlayer(); // need to check PvP state before spell effects, but act on it afterwards + && unit.IsPvP() && (unit.IsInCombat() || unit.IsCharmedOwnedByPlayerOrPlayer()) && spell.GetCaster().IsPlayer(); // need to check PvP state before spell effects, but act on it afterwards if (_spellHitTarget) {