AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "ThreatMgr.h"
Private Member Functions | |
HostileReference * | FindReference (Unit const *who, bool includeOffline) const |
void | _addThreat (Unit *victim, float threat) |
Private Attributes | |
HostileReference * | iCurrentVictim |
Unit * | iOwner |
uint32 | iUpdateTimer |
ThreatContainer | iThreatContainer |
ThreatContainer | iThreatOfflineContainer |
Friends | |
class | HostileReference |
|
explicit |
|
inline |
References clearReferences().
|
private |
References ThreatContainer::addReference(), HostileReference::AddThreat(), ThreatContainer::AddThreat(), HostileReference, Player::IsGameMaster(), Object::IsPlayer(), iThreatContainer, iThreatOfflineContainer, HostileReference::setOnlineOfflineState(), and Object::ToPlayer().
Referenced by DoAddThreat().
void ThreatMgr::AddThreat | ( | Unit * | victim, |
float | threat, | ||
SpellSchoolMask | schoolMask = SPELL_SCHOOL_MASK_NORMAL , |
||
SpellInfo const * | threatSpell = nullptr |
||
) |
References ThreatCalcHelper::calcThreat(), DoAddThreat(), iOwner, ThreatCalcHelper::isValidProcess(), and Object::ToCreature().
Referenced by HostileReference::AddThreat(), Unit::AddThreat(), ScriptedAI::DoAddThreat(), TemporaryThreatModifierEvent::Execute(), npc_frostwing_vrykul::npc_frostwing_vrykulAI::SpellHitTarget(), boss_drakkisath::boss_drakkisathAI::UpdateAI(), boss_grilek::boss_grilekAI::UpdateAI(), boss_gothik::boss_gothikAI::UpdateAI(), and boss_netherspite::UpdatePortals().
|
inline |
References ThreatContainer::empty(), iThreatContainer, and iThreatOfflineContainer.
void ThreatMgr::ClearAllThreat | ( | ) |
References Unit::CanHaveThreatList(), clearReferences(), iOwner, isThreatListEmpty(), and Unit::SendClearThreatListOpcode().
Referenced by CreatureAI::_EnterEvadeMode(), Unit::CleanupBeforeRemoveFromMap(), boss_kiljaeden::boss_kiljaedenAI::DamageTaken(), boss_grand_champion::boss_grand_championAI::DamageTaken(), npc_crystalline_frayer::npc_crystalline_frayerAI::DamageTaken(), npc_magister_aledis::DamageTaken(), npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI::DamageTaken(), npc_dark_nucleus::npc_dark_nucleusAI::DamageTaken(), npc_crok_scourgebane::npc_crok_scourgebaneAI::DoAction(), npc_spark_of_ionar::npc_spark_of_ionarAI::DoAction(), npc_taskmaster_fizzule::npc_taskmaster_fizzuleAI::DoFriend(), npc_unkor_the_ruthless::npc_unkor_the_ruthlessAI::DoNice(), npc_tirion_fordring_tft::npc_tirion_fordringAI::EnterEvadeMode(), GuardAI::EnterEvadeMode(), boss_doomrel::boss_doomrelAI::EnterEvadeMode(), npc_koltira_deathweaver::npc_koltira_deathweaverAI::EnterEvadeMode(), npc_varian_wrynn::npc_varian_wrynnAI::EnterEvadeMode(), npc_thrall_bfu::npc_thrall_bfuAI::EnterEvadeMode(), npc_pos_freed_slave::npc_pos_freed_slaveAI::EnterEvadeMode(), npc_high_overlord_saurfang_igb::npc_high_overlord_saurfang_igbAI::EnterEvadeMode(), npc_muradin_bronzebeard_igb::npc_muradin_bronzebeard_igbAI::EnterEvadeMode(), gunship_npc_AI::EnterEvadeMode(), npc_gunship_boarding_addAI::EnterEvadeMode(), npc_terenas_menethil::npc_terenas_menethilAI::EnterEvadeMode(), violet_hold_trashAI::EnterEvadeMode(), npc_pet_hunter_snake_trap::EnterEvadeMode(), npc_escortAI::EnterEvadeMode(), FollowerAI::EnterEvadeMode(), npc_raging_flames::FixateRandomTarget(), spell_q11919_q11940_drake_hunt_aura::HandleEffectRemove(), PetAI::HandleReturnMovement(), Unit::Kill(), boss_urom::boss_uromAI::LeaveCombat(), Unit::setDeathState(), spell_putricide_ooze_channel::StartAttack(), npc_highlord_darion_mograine::npc_highlord_darion_mograineAI::UpdateAI(), npc_snobold_vassal::npc_snobold_vassalAI::UpdateAI(), boss_malygos::boss_malygosAI::UpdateAI(), and npc_aeranas::npc_aeranasAI::UpdateAI().
void ThreatMgr::clearReferences | ( | ) |
References ThreatContainer::clearReferences(), iCurrentVictim, iThreatContainer, iThreatOfflineContainer, iUpdateTimer, and THREAT_UPDATE_INTERVAL.
Referenced by ClearAllThreat(), boss_eadric::boss_eadricAI::DamageTaken(), boss_paletress::boss_paletressAI::DamageTaken(), spell_halion_twilight_phasing_aura::OnApply(), spell_halion_twilight_phasing_aura::OnRemove(), and ~ThreatMgr().
|
inline |
References FindReference().
void ThreatMgr::DoAddThreat | ( | Unit * | victim, |
float | threat | ||
) |
References _addThreat(), CalculatePct(), GetOwner(), Unit::GetRedirectThreatPercent(), Unit::GetRedirectThreatTarget(), ThreatCalcHelper::isValidProcess(), and Unit::ToTempSummon().
Referenced by AddThreat(), Spell::EffectTaunt(), and HostileRefMgr::threatAssist().
|
inlineprivate |
References ThreatContainer::getReferenceByTarget(), iThreatContainer, and iThreatOfflineContainer.
Referenced by ClearThreat(), and ResetThreat().
|
inline |
References GetThreatList().
|
inline |
References getCurrentVictim(), and Unit::GetVictim().
Referenced by NonTankTargetSelector::operator()(), and UnitAI::SelectTargetList().
|
inline |
References iCurrentVictim.
Referenced by GetCurrentVictim(), getHostileTarget(), processThreatEvent(), and tauntApply().
Unit * ThreatMgr::getHostileTarget | ( | ) |
References getCurrentVictim(), GetOwner(), Reference< TO, FROM >::getTarget(), iThreatContainer, ThreatContainer::SelectNextVictim(), setCurrentVictim(), and ThreatContainer::update().
Referenced by SelectVictim(), and Creature::SelectVictim().
|
inline |
References iThreatOfflineContainer.
|
inline |
References ThreatContainer::GetThreatList(), and iThreatOfflineContainer.
Referenced by debug_commandscript::HandleDebugThreatListCommand(), and Unit::SetPhaseMask().
|
inline |
References iThreatContainer.
Referenced by boss_razorgore::boss_razorgoreAI::CanAIAttack(), boss_hazzarah::CanAIAttack(), boss_jindo::CanAIAttack(), boss_renataki::boss_renatakiAI::CanAIAttack(), boss_nethermancer_sepethrea::CanAIAttack(), Spell::EffectTaunt(), boss_priestess_lackey_commonAI::RecalculateThreat(), and boss_faction_championsAI::RecalculateThreat().
|
inline |
References iOwner.
Referenced by HostileRefMgr::deleteReference(), HostileRefMgr::deleteReferencesForFaction(), HostileRefMgr::deleteReferencesOutOfRange(), DoAddThreat(), getHostileTarget(), HostileReference::GetOwner(), debug_commandscript::HandleDebugHostileRefListCommand(), npc_pet_mage_mirror_image::InitializeAI(), processThreatEvent(), HostileRefMgr::setOnlineOfflineState(), Unit::SetPhaseMask(), HostileRefMgr::threatAssist(), and Map::Update().
|
inline |
References ThreatContainer::GetThreatList(), and iThreatContainer.
Referenced by GetUnsortedThreatList(), and UnitAI::SelectTargetList().
float ThreatMgr::GetThreat | ( | Unit * | victim, |
bool | alsoSearchOfflineList = false |
||
) |
References ThreatContainer::getReferenceByTarget(), HostileReference::GetThreat(), iThreatContainer, and iThreatOfflineContainer.
Referenced by boss_mor_grayhoof::CastRandomSpell(), ScriptedAI::DoGetThreat(), Spell::EffectTaunt(), Creature::ModifyThreatPercentTemp(), processThreatEvent(), boss_priestess_lackey_commonAI::RecalculateThreat(), boss_faction_championsAI::RecalculateThreat(), tauntApply(), boss_drakkisath::boss_drakkisathAI::UpdateAI(), and boss_thaddius_summon::boss_thaddius_summonAI::UpdateAI().
|
inline |
References ThreatContainer::GetThreatList(), and iThreatContainer.
Referenced by boss_lady_deathwhisper::boss_lady_deathwhisperAI::DamageTaken(), boss_ysondre::boss_ysondreAI::DamageTaken(), UnitAI::DoAddAuraToAllHostilePlayers(), UnitAI::DoCastToAllHostilePlayers(), boss_faction_championsAI::EnemiesInRange(), boss_ragnaros::boss_ragnarosAI::EnterEvadeMode(), boss_murmur::EnterEvadeMode(), boss_alar::EnterEvadeMode(), boss_ouro::EnterEvadeMode(), boss_supremus::FindHatefulStrikeTarget(), GetAnyTarget(), SmartScript::GetTargets(), GetThreatListSize(), debug_commandscript::HandleDebugThreatListCommand(), Unit::IsInCombatWith(), boss_blackheart_the_inciter::JustEngagedWith(), SmartScript::ProcessAction(), SmartScript::ProcessEvent(), boss_priestess_lackey_commonAI::RecalculateThreat(), boss_faction_championsAI::RecalculateThreat(), boss_faction_championsAI::SelectEnemyCaster(), npc_scholomance_occultist::npc_scholomance_occultistAI::SelectUnitCasting(), Unit::SendChangeCurrentVictimOpcode(), Unit::SendThreatListUpdate(), Unit::SetPhaseMask(), npc_frostwing_vrykul::npc_frostwing_vrykulAI::SpellHitTarget(), BossAI::TeleportCheaters(), boss_nefarian::UpdateAI(), boss_yazzai::UpdateAI(), boss_mandokir::boss_mandokirAI::UpdateAI(), boss_renataki::boss_renatakiAI::UpdateAI(), boss_taldaram::UpdateAI(), npc_green_dragon_combat_trigger::npc_green_dragon_combat_triggerAI::UpdateAI(), boss_kelthuzad::boss_kelthuzadAI::UpdateAI(), boss_patchwerk::boss_patchwerkAI::UpdateAI(), boss_sapphiron::boss_sapphironAI::UpdateAI(), and boss_the_lurker_below::UpdateAI().
|
inline |
References GetThreatList().
Referenced by boss_razorgore::boss_razorgoreAI::CanAIAttack(), boss_hazzarah::CanAIAttack(), boss_jindo::CanAIAttack(), boss_renataki::boss_renatakiAI::CanAIAttack(), boss_nethermancer_sepethrea::CanAIAttack(), boss_jindo::JustSummoned(), boss_bug_trio::MovementInform(), StoneGripTargetSelector::operator()(), boss_jeklik::PathEndReached(), SmartScript::ProcessAction(), UnitAI::SelectTarget(), UnitAI::SelectTargetList(), Creature::Update(), boss_hakkar::boss_hakkarAI::UpdateAI(), boss_jindo::UpdateAI(), and HostileRefMgr::UpdateVisibility().
float ThreatMgr::getThreatWithoutTemp | ( | Unit * | victim, |
bool | alsoSearchOfflineList = false |
||
) |
References ThreatContainer::getReferenceByTarget(), HostileReference::getTempThreatModifier(), HostileReference::GetThreat(), iThreatContainer, and iThreatOfflineContainer.
Referenced by boss_blood_queen_lana_thel::boss_blood_queen_lana_thelAI::UpdateAI().
|
inline |
References GetSortedThreatList().
Referenced by boss_attumen::IsSummonedBy(), and UnitAI::SelectTargetList().
bool ThreatMgr::isNeedUpdateToClient | ( | uint32 | time | ) |
References isThreatListEmpty(), iUpdateTimer, and THREAT_UPDATE_INTERVAL.
|
inline |
References ThreatContainer::empty(), and iThreatContainer.
Referenced by ClearAllThreat(), ScriptedAI::DoResetThreatList(), StartMovementEvent::Execute(), isNeedUpdateToClient(), Creature::SelectVictim(), Unit::TauntFadeOut(), npc_raging_spirit::npc_raging_spiritAI::UpdateAI(), and CreatureAI::UpdateVictim().
References iThreatContainer, and ThreatContainer::ModifyThreatByPercent().
Referenced by boss_mor_grayhoof::CastRandomSpell(), ScriptedAI::DoModifyThreatByPercent(), Spell::EffectModifyThreatPercent(), TemporaryThreatModifierEvent::Execute(), spell_enveloping_webs::HandleOnHit(), spell_arcane_vacuum::HandleOnHit(), Unit::HandleProcTriggerSpell(), spell_gurtogg_eject::HandleScriptEffect(), Creature::ModifyThreatPercentTemp(), SmartScript::ProcessAction(), boss_priestess_lackey_commonAI::RecalculateThreat(), boss_faction_championsAI::RecalculateThreat(), boss_ouro::SpellHitTarget(), boss_drakkisath::boss_drakkisathAI::UpdateAI(), boss_hakkar::boss_hakkarAI::UpdateAI(), boss_mandokir::boss_mandokirAI::UpdateAI(), and boss_thaddius_summon::boss_thaddius_summonAI::UpdateAI().
void ThreatMgr::processThreatEvent | ( | ThreatRefStatusChangeEvent * | threatRefStatusChangeEvent | ) |
References ThreatContainer::addReference(), getCurrentVictim(), ThreatRefStatusChangeEvent::getFValue(), GetOwner(), ThreatRefStatusChangeEvent::getReference(), HostileReference::GetThreat(), GetThreat(), UnitBaseEvent::getType(), ObjectAccessor::GetUnit(), HostileReference::getUnitGuid(), iOwner, HostileReference::IsOnline(), iThreatContainer, iThreatOfflineContainer, ThreatContainer::remove(), Unit::SendRemoveFromThreatListOpcode(), setCurrentVictim(), setDirty(), ThreatRefStatusChangeEvent::setThreatMgr(), UEV_THREAT_REF_ONLINE_STATUS, UEV_THREAT_REF_REMOVE_FROM_LIST, and UEV_THREAT_REF_THREAT_CHANGE.
Referenced by HostileReference::fireStatusChanged().
|
inline |
References iThreatContainer, ThreatContainer::iThreatList, and setDirty().
Referenced by boss_gothik::boss_gothikAI::UpdateAI().
void ThreatMgr::ResetAllThreat | ( | ) |
References iThreatContainer, ThreatContainer::iThreatList, and setDirty().
Referenced by npc_vengeful_shade::npc_vengeful_shadeAI::AttackStart(), boss_thorim_start_npcs::boss_thorim_start_npcsAI::DamageTaken(), ScriptedAI::DoResetThreatList(), spell_karazhan_blink::HandleDummy(), spell_tharon_ja_dummy_aura::HandleEffectRemove(), spell_pursue::HandleScript(), spell_leotheras_whirlwind::HandleScriptEffect(), npc_pet_mage_mirror_image::MySelectNextTarget(), boss_talon_king_ikiss::Reset(), npc_ulduar_iron_construct::npc_ulduar_iron_constructAI::SpellHit(), npc_frostwing_vrykul::npc_frostwing_vrykulAI::SpellHitTarget(), boss_sartura::UpdateAI(), npc_sartura_royal_guard::UpdateAI(), npc_toc5_grand_champion_minion::npc_toc5_grand_champion_minionAI::UpdateAI(), boss_grand_champion::boss_grand_championAI::UpdateAI(), boss_tharon_ja::boss_tharon_jaAI::UpdateAI(), boss_eck::boss_eckAI::UpdateAI(), and npc_frozen_orb::npc_frozen_orbAI::UpdateAI().
|
inline |
References FindReference().
Referenced by ScriptedAI::DoResetThreat(), and spell_kaelthas_mind_control::HandleEffect().
|
inline |
References getHostileTarget().
void ThreatMgr::setCurrentVictim | ( | HostileReference * | hostileRef | ) |
References iCurrentVictim, iOwner, and Unit::SendChangeCurrentVictimOpcode().
Referenced by Spell::EffectTaunt(), getHostileTarget(), and processThreatEvent().
|
inline |
References iThreatContainer, and ThreatContainer::setDirty().
Referenced by processThreatEvent(), resetAggro(), and ResetAllThreat().
void ThreatMgr::tauntApply | ( | Unit * | taunter | ) |
References getCurrentVictim(), ThreatContainer::getReferenceByTarget(), HostileReference::getTempThreatModifier(), HostileReference::GetThreat(), GetThreat(), iThreatContainer, and HostileReference::setTempThreat().
void ThreatMgr::tauntFadeOut | ( | Unit * | taunter | ) |
References ThreatContainer::getReferenceByTarget(), iThreatContainer, and HostileReference::resetTempThreat().
|
friend |
Referenced by _addThreat().
|
private |
Referenced by clearReferences(), getCurrentVictim(), and setCurrentVictim().
|
private |
Referenced by AddThreat(), ClearAllThreat(), GetOwner(), processThreatEvent(), and setCurrentVictim().
|
private |
Referenced by _addThreat(), areThreatListsEmpty(), clearReferences(), FindReference(), getHostileTarget(), GetOnlineContainer(), GetSortedThreatList(), GetThreat(), GetThreatList(), getThreatWithoutTemp(), isThreatListEmpty(), ModifyThreatByPercent(), processThreatEvent(), resetAggro(), ResetAllThreat(), setDirty(), tauntApply(), and tauntFadeOut().
|
private |
|
private |
Referenced by clearReferences(), and isNeedUpdateToClient().