backport nosttbc 404f4b1 fixes for spirit of redemption

https://github.com/NostalriusTBC/Core/pull/5
This commit is contained in:
robinsch 2016-05-07 21:40:19 +01:00 committed by Antz
parent b5f299c926
commit 4f176795ff
3 changed files with 16 additions and 1 deletions

View File

@ -9424,6 +9424,10 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool
if (IsNonMeleeSpellCasted(false))
{ return EQUIP_ERR_CANT_DO_RIGHT_NOW; }
// prevent equip item in Spirit of Redemption (Aura: 27827)
if (HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
{ return EQUIP_ERR_CANT_DO_RIGHT_NOW; }
}
uint8 eslot = FindEquipSlot(pProto, slot, swap);

View File

@ -4462,6 +4462,11 @@ SpellCastResult Spell::CheckCast(bool strict)
// check if target is in combat
if (non_caster_target && m_spellInfo->HasAttribute(SPELL_ATTR_EX_NOT_IN_COMBAT_TARGET) && target->IsInCombat())
{ return SPELL_FAILED_TARGET_AFFECTING_COMBAT; }
// check if target is affected by Spirit of Redemption (Aura: 27827)
if (target->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
{ return SPELL_FAILED_BAD_TARGETS; }
}
// zone check
uint32 zone, area;

View File

@ -4249,7 +4249,13 @@ void Aura::HandleSpiritOfRedemption(bool apply, bool Real)
{ target->SetStandState(UNIT_STAND_STATE_STAND); }
}
target->SetHealth(1);
// interrupt casting when entering Spirit of Redemption
if (target->IsNonMeleeSpellCasted(false))
{ target->InterruptNonMeleeSpells(false); }
// set health and mana to maximum
target->SetHealth(target->GetMaxHealth());
target->SetPower(POWER_MANA, target->GetMaxPower(POWER_MANA));
}
// die at aura end
else