From b4c955379f25434c07e79f0b10e316fea3e233d5 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Sat, 31 Aug 2024 17:39:01 -0400 Subject: [PATCH] Core/Spells: Implemented SPELL_ATTR9_CANNOT_KILL_TARGET Port From (https://github.com/TrinityCore/TrinityCore/commit/b3bdb4efef5d89df023fcccd6975edfd1ebd9903) --- Source/Framework/Constants/Spells/SpellConst.cs | 2 +- Source/Game/Entities/Unit/Unit.cs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index b340014fd..25e18ffe0 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1994,7 +1994,7 @@ namespace Framework.Constants DontConsumeChargeIfItemDeleted = 0x2000000, // NYI - some sort of bugfix attribute to prevent double item deletion? // (Programmer Only) Don't consume charge if item deleted ItemPassiveOnClient = 0x4000000, // Item Passive On Client ForceCorpseTarget = 0x8000000, // Causes the spell to continue executing effects on the target even if one of them kills it - Unk28 = 0x10000000, // 28 + CannotKillTarget = 0x10000000, // Cannot Kill Target Unk29 = 0x20000000, // 29 Unk30 = 0x40000000, // 30 Unk31 = 0x80000000 // 31 diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index cb051914b..2beb4161c 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -2782,6 +2782,9 @@ namespace Game.Entities } } + if (spellProto != null && spellProto.HasAttribute(SpellAttr9.CannotKillTarget) && damageTaken >= health) + damageTaken = health - 1; + if (attacker != null && attacker != victim) { Player killer = attacker.ToPlayer();