fix(Core/Spell): Implement SPELL_ATTR7_BYPASS_NO_RESURECTION_AURA (#7859)

Co-authored-by: stoneharry <3818405+stoneharry@users.noreply.github.com>
This commit is contained in:
Kitzunu
2021-10-27 13:29:11 +02:00
committed by GitHub
parent 8665452c28
commit 26ff29a1a0
3 changed files with 6 additions and 10 deletions

View File

@@ -619,18 +619,14 @@ void WorldSession::HandleSelfResOpcode(WorldPacket& /*recvData*/)
{
LOG_DEBUG("network", "WORLD: CMSG_SELF_RES"); // empty opcode
if (_player->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
return; // silent return, client should display error by itself and not send this opcode
if (_player->GetUInt32Value(PLAYER_SELF_RES_SPELL))
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(_player->GetUInt32Value(PLAYER_SELF_RES_SPELL)))
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(_player->GetUInt32Value(PLAYER_SELF_RES_SPELL));
if (spellInfo)
if (_player->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION) && !spell->HasAttribute(SPELL_ATTR7_BYPASS_NO_RESURRECTION_AURA))
{
_player->CastSpell(_player, spellInfo, false, 0);
_player->AddSpellAndCategoryCooldowns(spellInfo, 0);
return; // silent return, client should display error by itself and not send this opcode
}
_player->CastSpell(_player, spell->Id);
_player->SetUInt32Value(PLAYER_SELF_RES_SPELL, 0);
}
}

View File

@@ -1867,7 +1867,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
if (ExcludeTargetAuraSpell && unitTarget->HasAura(sSpellMgr->GetSpellIdForDifficulty(ExcludeTargetAuraSpell, caster)))
return SPELL_FAILED_TARGET_AURASTATE;
if (unitTarget->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION))
if (unitTarget->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION) && !HasAttribute(SPELL_ATTR7_BYPASS_NO_RESURRECTION_AURA))
if (HasEffect(SPELL_EFFECT_SELF_RESURRECT) || HasEffect(SPELL_EFFECT_RESURRECT) || HasEffect(SPELL_EFFECT_RESURRECT_NEW))
return SPELL_FAILED_TARGET_CANNOT_BE_RESURRECTED;

View File

@@ -573,7 +573,7 @@ enum SpellAttr7
SPELL_ATTR7_NO_ATTACK_PARRY = 0x01000000, // TITLE Spell cannot be parried 24@Attr7 DESCRIPTION Motivate, Mutilate, Perform Speech, Shattering Throw
SPELL_ATTR7_NO_ATTACK_MISS = 0x02000000, // TITLE Spell cannot be missed 25@Attr7
SPELL_ATTR7_TREAT_AS_NPC_AOE = 0x04000000, // TITLE Unknown attribute 26@Attr7
SPELL_ATTR7_BYPASS_NO_RESSURECTION_AURA = 0x08000000, // TITLE Unknown attribute 27@Attr7
SPELL_ATTR7_BYPASS_NO_RESURRECTION_AURA = 0x08000000, // TITLE Bypasses the prevent resurrection aura
SPELL_ATTR7_DO_NOT_COUNT_FOR_PVP_SCOREBOARD = 0x10000000, // TITLE Consolidate in raid buff frame (client only)
SPELL_ATTR7_REFLECTION_ONLY_DEFENDS = 0x20000000, // TITLE Unknown attribute 29@Attr7 DESCRIPTION only 69028, 71237
SPELL_ATTR7_CAN_PROC_FROM_SUPPRESSED_TARGET_PROCS = 0x40000000, // TITLE Unknown attribute 30@Attr7 DESCRIPTION Burning Determination, Divine Sacrifice, Earth Shield, Prayer of Mending