![]() |
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 |
| int32 | _tempModifier |
| TauntState | _taunted |
Friends | |
| class | ThreatManager |
| struct | CompareThreatLessThan |
Definition at line 269 of file ThreatManager.h.
| Enumerator | |
|---|---|
| ONLINE_STATE_ONLINE | |
| ONLINE_STATE_SUPPRESSED | |
| ONLINE_STATE_OFFLINE | |
Definition at line 273 of file ThreatManager.h.
| Enumerator | |
|---|---|
| TAUNT_STATE_DETAUNT | |
| TAUNT_STATE_NONE | |
| TAUNT_STATE_TAUNT | |
Definition at line 272 of file ThreatManager.h.
|
inlineexplicitprotected |
Definition at line 297 of file ThreatManager.h.
|
protectedvirtualdefault |
|
delete |
| void ThreatReference::AddThreat | ( | float | amount | ) |
Definition at line 44 of file ThreatManager.cpp.
References _baseAmount, _mgr, ThreatManager::_updateFlags, HeapNotifyDecreased(), HeapNotifyIncreased(), and UpdateNeeded.
Referenced by ThreatManager::AddThreat(), and boss_patchwerk::UpdateAI().
| void ThreatReference::ClearThreat | ( | ) |
Definition at line 151 of file ThreatManager.cpp.
References _mgr, and ThreatManager::ClearThreat().
Definition at line 91 of file ThreatManager.cpp.
References Object::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 278 of file ThreatManager.h.
Referenced by ThreatManager::AddThreat().
|
inline |
Definition at line 275 of file ThreatManager.h.
|
inline |
Definition at line 283 of file ThreatManager.h.
|
inline |
Definition at line 277 of file ThreatManager.h.
Referenced by ThreatManager::CompareReferencesLT(), and ThreatManager::MatchUnitThreatToHighestThreat().
|
inline |
Definition at line 276 of file ThreatManager.h.
Referenced by ThreatManager::GetCurrentVictim(), ThreatManager::GetFixateTarget(), ThreatManager::GetLastVictim(), ThreatManager::SendThreatListToClients(), boss_patchwerk::UpdateAI(), and UpdateOffline().
|
protected |
Definition at line 176 of file ThreatManager.cpp.
References _mgr, and ThreatManager::_sortedThreatList.
Referenced by AddThreat(), ScaleThreat(), UpdateOffline(), and UpdateTauntState().
|
protected |
Definition at line 171 of file ThreatManager.cpp.
References _mgr, and ThreatManager::_sortedThreatList.
Referenced by AddThreat(), ThreatManager::AddThreat(), ScaleThreat(), UpdateOffline(), and UpdateTauntState().
|
inline |
Definition at line 280 of file ThreatManager.h.
Referenced by ThreatManager::GetCurrentVictim(), ThreatManager::MatchUnitThreatToHighestThreat(), and ThreatManager::ReselectVictim().
|
inline |
Definition at line 285 of file ThreatManager.h.
|
inline |
Definition at line 282 of file ThreatManager.h.
Referenced by ThreatManager::ReselectVictim(), and UpdateOffline().
|
inline |
Definition at line 279 of file ThreatManager.h.
Referenced by ThreatManager::AddThreat().
|
inline |
Definition at line 281 of file ThreatManager.h.
|
inline |
Definition at line 284 of file ThreatManager.h.
Referenced by ThreatManager::MatchUnitThreatToHighestThreat(), and ShouldBeSuppressed().
|
inline |
Definition at line 289 of file ThreatManager.h.
|
delete |
| void ThreatReference::ScaleThreat | ( | float | factor | ) |
Definition at line 57 of file ThreatManager.cpp.
References _baseAmount, _mgr, ThreatManager::_updateFlags, HeapNotifyDecreased(), HeapNotifyIncreased(), and UpdateNeeded.
|
protected |
Definition at line 108 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 119 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 156 of file ThreatManager.cpp.
References _owner, _victim, Object::GetGUID(), Unit::GetThreatManager(), ThreatManager::PurgeThreatenedByMeRef(), and ThreatManager::PurgeThreatListRef().
Referenced by ThreatManager::ClearThreat().
| void ThreatReference::UpdateOffline | ( | ) |
Definition at line 70 of file ThreatManager.cpp.
References _mgr, _online, ThreatManager::_updateFlags, _victim, ForceHighestUpdate, 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 132 of file ThreatManager.cpp.
References _mgr, _owner, _taunted, ThreatManager::_updateFlags, Object::GetGUID(), HeapNotifyDecreased(), HeapNotifyIncreased(), SPELL_AURA_MOD_DETAUNT, TAUNT_STATE_DETAUNT, and UpdateNeeded.
|
friend |
Definition at line 326 of file ThreatManager.h.
|
friend |
Definition at line 325 of file ThreatManager.h.
|
protected |
Definition at line 317 of file ThreatManager.h.
Referenced by AddThreat(), and ScaleThreat().
|
protected |
Definition at line 312 of file ThreatManager.h.
Referenced by AddThreat(), ClearThreat(), HeapNotifyDecreased(), HeapNotifyIncreased(), ScaleThreat(), UpdateOffline(), and UpdateTauntState().
|
protected |
Definition at line 316 of file ThreatManager.h.
Referenced by ThreatManager::AddThreat(), ThreatManager::CompareReferencesLT(), and UpdateOffline().
|
protected |
Definition at line 311 of file ThreatManager.h.
Referenced by ShouldBeOffline(), ShouldBeSuppressed(), UnregisterAndFree(), and UpdateTauntState().
|
protected |
Definition at line 319 of file ThreatManager.h.
Referenced by ThreatManager::CompareReferencesLT(), and UpdateTauntState().
|
protected |
Definition at line 318 of file ThreatManager.h.
|
protected |
Definition at line 315 of file ThreatManager.h.
Referenced by ThreatManager::ClearThreat(), ThreatManager::ReselectVictim(), ShouldBeOffline(), ShouldBeSuppressed(), UnregisterAndFree(), and UpdateOffline().