![]() |
TrinityCore
|
#include <ThreatManager.h>
Inheritance diagram for ThreatReference:Public Types | |
| enum | TauntState : uint32 { TAUNT_STATE_DETAUNT = 0 , TAUNT_STATE_NONE = 1 , TAUNT_STATE_TAUNT = 2 } |
| enum | OnlineState { ONLINE_STATE_ONLINE = 2 , ONLINE_STATE_SUPPRESSED = 1 , ONLINE_STATE_OFFLINE = 0 } |
Public Member Functions | |
| Creature * | GetOwner () const |
| Unit * | GetVictim () const |
| float | GetThreat () const |
| OnlineState | GetOnlineState () const |
| bool | IsOnline () const |
| bool | IsAvailable () const |
| bool | IsSuppressed () const |
| bool | IsOffline () const |
| TauntState | GetTauntState () const |
| bool | IsTaunting () const |
| bool | IsDetaunted () const |
| void | AddThreat (float amount) |
| void | ScaleThreat (float factor) |
| void | ModifyThreatByPercent (int32 percent) |
| void | UpdateOffline () |
| void | ClearThreat () |
| ThreatReference (ThreatReference const &)=delete | |
| ThreatReference & | operator= (ThreatReference const &)=delete |
Protected Member Functions | |
| ThreatReference (ThreatManager *mgr, Unit *victim) | |
| virtual | ~ThreatReference ()=default |
| void | UnregisterAndFree () |
| bool | ShouldBeOffline () const |
| bool | ShouldBeSuppressed () const |
| void | UpdateTauntState (TauntState state=TAUNT_STATE_NONE) |
| void | HeapNotifyIncreased () |
| void | HeapNotifyDecreased () |
Static Protected Member Functions | |
| static bool | FlagsAllowFighting (Unit const *a, Unit const *b) |
Protected Attributes | |
| Creature *const | _owner |
| ThreatManager & | _mgr |
| Unit *const | _victim |
| OnlineState | _online |
| float | _baseAmount |
| float | _tempModifier |
| TauntState | _taunted |
Friends | |
| class | ThreatManager |
| struct | CompareThreatLessThan |
Definition at line 264 of file ThreatManager.h.
| Enumerator | |
|---|---|
| ONLINE_STATE_ONLINE | |
| ONLINE_STATE_SUPPRESSED | |
| ONLINE_STATE_OFFLINE | |
Definition at line 268 of file ThreatManager.h.
| Enumerator | |
|---|---|
| TAUNT_STATE_DETAUNT | |
| TAUNT_STATE_NONE | |
| TAUNT_STATE_TAUNT | |
Definition at line 267 of file ThreatManager.h.
|
inlineexplicitprotected |
Definition at line 292 of file ThreatManager.h.
|
protectedvirtualdefault |
|
delete |
| void ThreatReference::AddThreat | ( | float | amount | ) |
Definition at line 38 of file ThreatManager.cpp.
References _baseAmount, _mgr, ThreatManager::_needClientUpdate, HeapNotifyDecreased(), and HeapNotifyIncreased().
Referenced by ThreatManager::AddThreat(), and boss_patchwerk::UpdateAI().
| void ThreatReference::ClearThreat | ( | ) |
Definition at line 142 of file ThreatManager.cpp.
References _mgr, and ThreatManager::ClearThreat().
Definition at line 82 of file ThreatManager.cpp.
References BaseEntity::GetTypeId(), Unit::HasUnitFlag(), Creature::IsTrigger(), Object::ToCreature(), TYPEID_UNIT, UNIT_FLAG_IMMUNE_TO_NPC, UNIT_FLAG_IMMUNE_TO_PC, and UNIT_FLAG_PLAYER_CONTROLLED.
Referenced by ShouldBeOffline().
|
inline |
Definition at line 273 of file ThreatManager.h.
Referenced by ThreatManager::AddThreat().
|
inline |
Definition at line 270 of file ThreatManager.h.
|
inline |
Definition at line 278 of file ThreatManager.h.
|
inline |
Definition at line 272 of file ThreatManager.h.
Referenced by ThreatManager::CompareReferencesLT(), and ThreatManager::MatchUnitThreatToHighestThreat().
|
inline |
Definition at line 271 of file ThreatManager.h.
Referenced by ThreatManager::GetCurrentVictim(), ThreatManager::GetFixateTarget(), ThreatManager::GetLastVictim(), ThreatManager::SendThreatListToClients(), boss_patchwerk::UpdateAI(), and UpdateOffline().
|
protected |
Definition at line 167 of file ThreatManager.cpp.
References _mgr, and ThreatManager::_sortedThreatList.
Referenced by AddThreat(), ScaleThreat(), UpdateOffline(), and UpdateTauntState().
|
protected |
Definition at line 162 of file ThreatManager.cpp.
References _mgr, and ThreatManager::_sortedThreatList.
Referenced by AddThreat(), ThreatManager::AddThreat(), ScaleThreat(), UpdateOffline(), and UpdateTauntState().
|
inline |
Definition at line 275 of file ThreatManager.h.
Referenced by ThreatManager::GetCurrentVictim(), ThreatManager::MatchUnitThreatToHighestThreat(), and ThreatManager::ReselectVictim().
|
inline |
Definition at line 280 of file ThreatManager.h.
|
inline |
Definition at line 277 of file ThreatManager.h.
Referenced by ThreatManager::ReselectVictim(), and UpdateOffline().
|
inline |
Definition at line 274 of file ThreatManager.h.
Referenced by ThreatManager::AddThreat().
|
inline |
Definition at line 276 of file ThreatManager.h.
|
inline |
Definition at line 279 of file ThreatManager.h.
Referenced by ThreatManager::MatchUnitThreatToHighestThreat(), and ShouldBeSuppressed().
|
inline |
Definition at line 284 of file ThreatManager.h.
|
delete |
| void ThreatReference::ScaleThreat | ( | float | factor | ) |
Definition at line 50 of file ThreatManager.cpp.
References _baseAmount, _mgr, ThreatManager::_needClientUpdate, HeapNotifyDecreased(), and HeapNotifyIncreased().
|
protected |
Definition at line 99 of file ThreatManager.cpp.
References Creature::_IsTargetAcceptable(), _owner, _victim, Creature::CanCreatureAttack(), WorldObject::CanSeeOrDetect(), and FlagsAllowFighting().
Referenced by ThreatManager::GetCurrentVictim(), ThreatManager::GetLastVictim(), and UpdateOffline().
|
protected |
Definition at line 110 of file ThreatManager.cpp.
References _owner, _victim, Creature::GetMeleeDamageSchoolMask(), Unit::HasAuraType(), Unit::HasBreakableByDamageAuraType(), Unit::IsImmunedToDamage(), IsTaunting(), SPELL_AURA_MOD_CONFUSE, and SPELL_AURA_MOD_STUN.
Referenced by ThreatManager::AddThreat(), and UpdateOffline().
|
protected |
Definition at line 147 of file ThreatManager.cpp.
References _owner, _victim, BaseEntity::GetGUID(), Unit::GetThreatManager(), ThreatManager::PurgeThreatenedByMeRef(), and ThreatManager::PurgeThreatListRef().
Referenced by ThreatManager::ClearThreat().
| void ThreatReference::UpdateOffline | ( | ) |
Definition at line 62 of file ThreatManager.cpp.
References _mgr, _online, _victim, GetVictim(), HeapNotifyDecreased(), HeapNotifyIncreased(), IsOffline(), ONLINE_STATE_OFFLINE, ONLINE_STATE_ONLINE, ONLINE_STATE_SUPPRESSED, ThreatManager::RegisterForAIUpdate(), ThreatManager::SendRemoveToClients(), ShouldBeOffline(), and ShouldBeSuppressed().
Referenced by ThreatManager::AddThreat(), and ThreatManager::ReselectVictim().
|
protected |
Definition at line 123 of file ThreatManager.cpp.
References _mgr, ThreatManager::_needClientUpdate, _owner, _taunted, BaseEntity::GetGUID(), HeapNotifyDecreased(), HeapNotifyIncreased(), SPELL_AURA_MOD_DETAUNT, and TAUNT_STATE_DETAUNT.
|
friend |
Definition at line 321 of file ThreatManager.h.
|
friend |
Definition at line 320 of file ThreatManager.h.
|
protected |
Definition at line 312 of file ThreatManager.h.
Referenced by AddThreat(), and ScaleThreat().
|
protected |
Definition at line 307 of file ThreatManager.h.
Referenced by AddThreat(), ClearThreat(), HeapNotifyDecreased(), HeapNotifyIncreased(), ScaleThreat(), UpdateOffline(), and UpdateTauntState().
|
protected |
Definition at line 311 of file ThreatManager.h.
Referenced by ThreatManager::AddThreat(), ThreatManager::CompareReferencesLT(), and UpdateOffline().
|
protected |
Definition at line 306 of file ThreatManager.h.
Referenced by ShouldBeOffline(), ShouldBeSuppressed(), UnregisterAndFree(), and UpdateTauntState().
|
protected |
Definition at line 314 of file ThreatManager.h.
Referenced by ThreatManager::CompareReferencesLT(), and UpdateTauntState().
|
protected |
Definition at line 313 of file ThreatManager.h.
|
protected |
Definition at line 310 of file ThreatManager.h.
Referenced by ThreatManager::ClearThreat(), ThreatManager::ReselectVictim(), ShouldBeOffline(), ShouldBeSuppressed(), UnregisterAndFree(), and UpdateOffline().