[8552] implemented spells which can be casted while dead

i added a function IsDeathOnlySpell() which returns true
if this spell can ONLY be casted while dead, so i haven't
implemented all spells which could be cast while dead..
This commit is contained in:
balrok 2009-09-21 19:52:01 +02:00
parent 5385b385bc
commit 2da82a8c68
9 changed files with 25 additions and 11 deletions

View file

@ -3403,7 +3403,7 @@ bool Unit::AddAura(Aura *Aur)
// ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load)
if( !isAlive() && !IsDeathPersistentSpell(aurSpellInfo) &&
Aur->GetId() != 2584 && // Waiting to Resurrect (not have death persistence flag)
!IsDeathOnlySpell(aurSpellInfo) &&
(GetTypeId()!=TYPEID_PLAYER || !((Player*)this)->GetSession()->PlayerLoading()) )
{
delete Aur;
@ -9385,7 +9385,7 @@ void Unit::ClearInCombat()
((Player*)this)->UpdatePotionCooldown();
}
bool Unit::isTargetableForAttack() const
bool Unit::isTargetableForAttack(bool inverseAlive /*=false*/) const
{
if (GetTypeId()==TYPEID_PLAYER && ((Player *)this)->isGameMaster())
return false;
@ -9397,7 +9397,10 @@ bool Unit::isTargetableForAttack() const
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
return false;
return IsInWorld() && isAlive() && !hasUnitState(UNIT_STAT_DIED)&& !isInFlight() /*&& !isStealth()*/;
if (!(isAlive() ^ inverseAlive))
return false;
return IsInWorld() && !hasUnitState(UNIT_STAT_DIED)&& !isInFlight() /*&& !isStealth()*/;
}
int32 Unit::ModifyHealth(int32 dVal)