mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user