[8690] added unit auraFlag variable

this can be used for faster checking if an unit has a specific
aura applied..
also implemented the alive-invisible auras now with this way
This commit is contained in:
balrok 2009-10-20 18:53:16 +02:00
parent 46389e4e1c
commit 20e8982075
4 changed files with 21 additions and 4 deletions

View file

@ -2467,6 +2467,16 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
m_target->PlayDirectSound(14972, (Player *)m_target);
}
return;
case 10848:
case 36978:
case 40131:
case 27978:
case 33900:
if (apply)
m_target->m_AuraFlags |= UNIT_AURAFLAG_ALIVE_INVISIBLE;
else
m_target->m_AuraFlags |= ~UNIT_AURAFLAG_ALIVE_INVISIBLE;
return;
}
break;
}

View file

@ -104,6 +104,7 @@ Unit::Unit()
//m_AurasCheck = 2000;
//m_removeAuraTimer = 4;
m_AurasUpdateIterator = m_Auras.end();
m_AuraFlags = 0;
m_Visibility = VISIBILITY_ON;
@ -10627,9 +10628,7 @@ bool Unit::isVisibleForInState( Player const* u, WorldObject const* viewPoint, b
/// returns true if creature can't be seen by alive units
bool Unit::isInvisibleForAlive() const
{
// TODO: more generic check for those auras
// TODO: maybe we also don't need an isAlive() check for visibilty.. but only those auras
if (HasAura(10848) || HasAura(36978) || HasAura(40131) || HasAura(27978) || HasAura(33900))
if (m_AuraFlags & UNIT_AURAFLAG_ALIVE_INVISIBLE)
return true;
// TODO: maybe spiritservices also have just an aura
return isSpiritService();

View file

@ -469,6 +469,12 @@ enum DamageEffectType
SELF_DAMAGE = 5
};
/// internal used flags for marking special auras - for example some dummy-auras
enum UnitAuraFlags
{
UNIT_AURAFLAG_ALIVE_INVISIBLE = 0x1, // aura which makes unit invisible for alive
};
enum UnitVisibility
{
VISIBILITY_OFF = 0, // absolute, not detectable, GM-like, can see all other
@ -1390,6 +1396,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
Aura* GetDummyAura(uint32 spell_id) const;
uint32 m_AuraFlags;
uint32 GetDisplayId() { return GetUInt32Value(UNIT_FIELD_DISPLAYID); }
void SetDisplayId(uint32 modelId);
uint32 GetNativeDisplayId() { return GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID); }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8689"
#define REVISION_NR "8690"
#endif // __REVISION_NR_H__