mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[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:
parent
5385b385bc
commit
2da82a8c68
9 changed files with 25 additions and 11 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue