From 1daa90dfb9c00eee182a211d13b7c619fbe3d4c5 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 5 May 2022 09:36:14 -0400 Subject: [PATCH] Core/Spells: Implement SPELL_ATTR7_BYPASS_NO_RESURRECT_AURA Port From (https://github.com/TrinityCore/TrinityCore/commit/2ae67de4c0f327edc60d5da9cc815016d48b7228) --- Source/Framework/Constants/Spells/SpellConst.cs | 2 +- Source/Game/Handlers/SpellHandler.cs | 12 ++++++++---- Source/Game/Spells/SpellInfo.cs | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 2c42b2ed8..077aefa6b 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1845,7 +1845,7 @@ namespace Framework.Constants Unk24 = 0x1000000, // 24 Motivate, Mutilate, Perform Speech, Shattering Throw Unk25 = 0x2000000, // 25 Unk26 = 0x4000000, // 26 - Unk27 = 0x8000000, // 27 Not Set + BypassNoResurrectAura = 0x8000000, // 27 Bypass No Resurrect Aura ConsolidatedRaidBuff = 0x10000000, // 28 Related To Player Positive Buff Unk29 = 0x20000000, // 29 Only 69028, 71237 Unk30 = 0x40000000, // 30 Burning Determination, Divine Sacrifice, Earth Shield, Prayer Of Mending diff --git a/Source/Game/Handlers/SpellHandler.cs b/Source/Game/Handlers/SpellHandler.cs index 4c31cf9fd..f98d7eacf 100644 --- a/Source/Game/Handlers/SpellHandler.cs +++ b/Source/Game/Handlers/SpellHandler.cs @@ -512,13 +512,17 @@ namespace Game [WorldPacketHandler(ClientOpcodes.SelfRes)] void HandleSelfRes(SelfRes selfRes) { - if (_player.HasAuraType(AuraType.PreventResurrection)) - return; // silent return, client should display error by itself and not send this opcode - List selfResSpells = _player.m_activePlayerData.SelfResSpells; if (!selfResSpells.Contains(selfRes.SpellId)) return; - + + SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(selfRes.SpellId, _player.GetMap().GetDifficultyID()); + if (spellInfo == null) + return; + + if (_player.HasAuraType(AuraType.PreventResurrection) && !spellInfo.HasAttribute(SpellAttr7.BypassNoResurrectAura)) + return; // silent return, client should display error by itself and not send this opcode + _player.CastSpell(_player, selfRes.SpellId, new CastSpellExtraArgs(_player.GetMap().GetDifficultyID())); _player.RemoveSelfResSpell(selfRes.SpellId); } diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index fc44c57fe..35a949883 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -1160,7 +1160,7 @@ namespace Game.Spells if (ExcludeTargetAuraSpell != 0 && unitTarget.HasAura(ExcludeTargetAuraSpell)) return SpellCastResult.TargetAurastate; - if (unitTarget.HasAuraType(AuraType.PreventResurrection)) + if (unitTarget.HasAuraType(AuraType.PreventResurrection) && !HasAttribute(SpellAttr7.BypassNoResurrectAura)) if (HasEffect(SpellEffectName.SelfResurrect) || HasEffect(SpellEffectName.Resurrect)) return SpellCastResult.TargetCannotBeResurrected;