mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[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:
parent
46389e4e1c
commit
20e8982075
4 changed files with 21 additions and 4 deletions
|
|
@ -2467,6 +2467,16 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
||||||
m_target->PlayDirectSound(14972, (Player *)m_target);
|
m_target->PlayDirectSound(14972, (Player *)m_target);
|
||||||
}
|
}
|
||||||
return;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ Unit::Unit()
|
||||||
//m_AurasCheck = 2000;
|
//m_AurasCheck = 2000;
|
||||||
//m_removeAuraTimer = 4;
|
//m_removeAuraTimer = 4;
|
||||||
m_AurasUpdateIterator = m_Auras.end();
|
m_AurasUpdateIterator = m_Auras.end();
|
||||||
|
m_AuraFlags = 0;
|
||||||
|
|
||||||
m_Visibility = VISIBILITY_ON;
|
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
|
/// returns true if creature can't be seen by alive units
|
||||||
bool Unit::isInvisibleForAlive() const
|
bool Unit::isInvisibleForAlive() const
|
||||||
{
|
{
|
||||||
// TODO: more generic check for those auras
|
if (m_AuraFlags & UNIT_AURAFLAG_ALIVE_INVISIBLE)
|
||||||
// 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))
|
|
||||||
return true;
|
return true;
|
||||||
// TODO: maybe spiritservices also have just an aura
|
// TODO: maybe spiritservices also have just an aura
|
||||||
return isSpiritService();
|
return isSpiritService();
|
||||||
|
|
|
||||||
|
|
@ -469,6 +469,12 @@ enum DamageEffectType
|
||||||
SELF_DAMAGE = 5
|
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
|
enum UnitVisibility
|
||||||
{
|
{
|
||||||
VISIBILITY_OFF = 0, // absolute, not detectable, GM-like, can see all other
|
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;
|
Aura* GetDummyAura(uint32 spell_id) const;
|
||||||
|
|
||||||
|
uint32 m_AuraFlags;
|
||||||
|
|
||||||
uint32 GetDisplayId() { return GetUInt32Value(UNIT_FIELD_DISPLAYID); }
|
uint32 GetDisplayId() { return GetUInt32Value(UNIT_FIELD_DISPLAYID); }
|
||||||
void SetDisplayId(uint32 modelId);
|
void SetDisplayId(uint32 modelId);
|
||||||
uint32 GetNativeDisplayId() { return GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID); }
|
uint32 GetNativeDisplayId() { return GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID); }
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8689"
|
#define REVISION_NR "8690"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue