![]() |
TrinityCore
|
#include <SpellHistory.h>
Classes | |
| struct | ChargeEntry |
| struct | CooldownEntry |
| struct | PersistenceHelper |
| struct | PersistenceHelper< Pet > |
| struct | PersistenceHelper< Player > |
Public Types | |
| using | Clock = std::chrono::system_clock |
| using | Duration = Milliseconds |
| using | TimePoint = std::chrono::time_point< Clock, Duration > |
| using | ChargeEntryCollection = std::deque< ChargeEntry > |
| using | CooldownStorageType = std::unordered_map< uint32, CooldownEntry > |
| using | CategoryCooldownStorageType = std::unordered_map< uint32, CooldownEntry * > |
| using | ChargeStorageType = std::unordered_map< uint32, ChargeEntryCollection > |
| using | GlobalCooldownStorageType = std::unordered_map< uint32, TimePoint > |
Public Member Functions | |
| SpellHistory (Unit *owner) | |
| ~SpellHistory () | |
| SpellHistory (SpellHistory const &)=delete | |
| SpellHistory (SpellHistory &&)=delete | |
| SpellHistory & | operator= (SpellHistory const &)=delete |
| SpellHistory & | operator= (SpellHistory &&)=delete |
| template<class OwnerType > | |
| void | LoadFromDB (PreparedQueryResult cooldownsResult, PreparedQueryResult chargesResult) |
| template<class OwnerType > | |
| void | SaveToDB (CharacterDatabaseTransaction trans) |
| void | Update () |
| void | HandleCooldowns (SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr) |
| bool | IsReady (SpellInfo const *spellInfo, uint32 itemId=0) const |
| void | WritePacket (WorldPackets::Spells::SendSpellHistory *sendSpellHistory) const |
| void | WritePacket (WorldPackets::Spells::SendSpellCharges *sendSpellCharges) const |
| void | WritePacket (WorldPackets::Pet::PetSpells *petSpells) const |
| void | StartCooldown (SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr, bool onHold=false, Optional< Duration > forcedCooldown={}) |
| void | SendCooldownEvent (SpellInfo const *spellInfo, uint32 itemId=0, Spell *spell=nullptr, bool startCooldown=true) |
| void | AddCooldown (uint32 spellId, uint32 itemId, Duration cooldownDuration) |
| void | AddCooldown (uint32 spellId, uint32 itemId, TimePoint cooldownEnd, uint32 categoryId, TimePoint categoryEnd, bool onHold=false) |
| void | ModifyCooldown (uint32 spellId, Duration cooldownMod, bool withoutCategoryCooldown=false) |
| void | ModifyCooldown (SpellInfo const *spellInfo, Duration cooldownMod, bool withoutCategoryCooldown=false) |
| template<Trinity::invocable_r< bool, CooldownEntry const & > Predicate> | |
| void | ModifyCoooldowns (Predicate &&predicate, Duration cooldownMod, bool withoutCategoryCooldown=false) |
| template<Trinity::invocable_r< bool, CooldownEntry const & > Predicate> | |
| void | UpdateCooldownRecoveryRate (Predicate &&predicate, float modChange, bool apply) |
| void | ResetCooldown (uint32 spellId, bool update=false) |
| template<Trinity::invocable_r< bool, CooldownEntry const & > Predicate> | |
| void | ResetCooldowns (Predicate &&predicate, bool update=false) |
| void | ResetAllCooldowns () |
| bool | HasCooldown (SpellInfo const *spellInfo, uint32 itemId=0) const |
| bool | HasCooldown (uint32 spellId, uint32 itemId=0) const |
| bool | HasCooldownOnHold (uint32 spellId) const |
| Duration | GetRemainingCooldown (SpellInfo const *spellInfo) const |
| Duration | GetRemainingCategoryCooldown (uint32 categoryId) const |
| Duration | GetRemainingCategoryCooldown (SpellInfo const *spellInfo) const |
| void | LockSpellSchool (SpellSchoolMask schoolMask, Duration lockoutTime) |
| bool | IsSchoolLocked (SpellSchoolMask schoolMask) const |
| void | ConsumeCharge (uint32 chargeCategoryId) |
| void | ModifyChargeRecoveryTime (uint32 chargeCategoryId, Duration cooldownMod) |
| void | UpdateChargeRecoveryRate (uint32 chargeCategoryId, float modChange, bool apply) |
| void | RestoreCharge (uint32 chargeCategoryId) |
| void | ResetCharges (uint32 chargeCategoryId) |
| void | ResetAllCharges () |
| bool | HasCharge (uint32 chargeCategoryId) const |
| int32 | GetMaxCharges (uint32 chargeCategoryId) const |
| int32 | GetChargeRecoveryTime (uint32 chargeCategoryId) const |
| bool | HasGlobalCooldown (SpellInfo const *spellInfo) const |
| void | AddGlobalCooldown (SpellInfo const *spellInfo, Duration duration) |
| void | CancelGlobalCooldown (SpellInfo const *spellInfo) |
| Duration | GetRemainingGlobalCooldown (SpellInfo const *spellInfo) const |
| bool | IsPaused () const |
| void | PauseCooldowns () |
| void | ResumeCooldowns () |
| void | AtExitCombat () |
| void | SaveCooldownStateBeforeDuel () |
| void | RestoreCooldownStateAfterDuel () |
Static Public Member Functions | |
| static void | GetCooldownDurations (SpellInfo const *spellInfo, uint32 itemId, Duration *cooldown, uint32 *categoryId, Duration *categoryCooldown) |
Private Member Functions | |
| Player * | GetPlayerOwner () const |
| void | ModifySpellCooldown (uint32 spellId, Duration cooldownMod, bool withoutCategoryCooldown) |
| void | ModifySpellCooldown (CooldownStorageType::iterator &itr, Duration cooldownMod, bool withoutCategoryCooldown) |
| void | UpdateCooldownRecoveryRate (CooldownStorageType::iterator &itr, float modChange, bool apply) |
| void | ResetCooldown (CooldownStorageType::iterator &itr, bool update=false) |
| void | SendClearCooldowns (std::vector< int32 > &&cooldowns) const |
| CooldownStorageType::iterator | EraseCooldown (CooldownStorageType::iterator itr) |
| void | SendSetSpellCharges (uint32 chargeCategoryId, ChargeEntryCollection const &chargeCollection) const |
Definition at line 58 of file SpellHistory.h.
| using SpellHistory::CategoryCooldownStorageType = std::unordered_map<uint32 , CooldownEntry*> |
Definition at line 87 of file SpellHistory.h.
| using SpellHistory::ChargeEntryCollection = std::deque<ChargeEntry> |
Definition at line 85 of file SpellHistory.h.
| using SpellHistory::ChargeStorageType = std::unordered_map<uint32 , ChargeEntryCollection> |
Definition at line 88 of file SpellHistory.h.
| using SpellHistory::Clock = std::chrono::system_clock |
Definition at line 61 of file SpellHistory.h.
| using SpellHistory::CooldownStorageType = std::unordered_map<uint32 , CooldownEntry> |
Definition at line 86 of file SpellHistory.h.
| using SpellHistory::Duration = Milliseconds |
Definition at line 62 of file SpellHistory.h.
| using SpellHistory::GlobalCooldownStorageType = std::unordered_map<uint32 , TimePoint> |
Definition at line 89 of file SpellHistory.h.
| using SpellHistory::TimePoint = std::chrono::time_point<Clock, Duration> |
Definition at line 63 of file SpellHistory.h.
|
explicit |
Definition at line 140 of file SpellHistory.cpp.
|
default |
|
delete |
|
delete |
Definition at line 118 of file SpellHistory.h.
Referenced by Player::ApplyEquipCooldown(), Aura::HandleAuraSpecificMods(), LockSpellSchool(), npc_gunship_boarding_addAI::MovementInform(), StartCooldown(), gunship_npc_AI::TriggerBurningPitch(), and npc_gunship_rocketeer::UpdateAI().
| void SpellHistory::AddCooldown | ( | uint32 | spellId, |
| uint32 | itemId, | ||
| TimePoint | cooldownEnd, | ||
| uint32 | categoryId, | ||
| TimePoint | categoryEnd, | ||
| bool | onHold = false |
||
| ) |
Definition at line 551 of file SpellHistory.cpp.
References _categoryCooldowns, _spellCooldowns, SpellHistory::CooldownEntry::CategoryEnd, SpellHistory::CooldownEntry::CategoryId, SpellHistory::CooldownEntry::CooldownEnd, SpellHistory::CooldownEntry::ItemId, SpellHistory::CooldownEntry::OnHold, and SpellHistory::CooldownEntry::SpellId.
Definition at line 1025 of file SpellHistory.cpp.
References _globalCooldowns, and SpellInfo::StartRecoveryCategory.
Referenced by Player::EquipItem(), Spell::finish(), and Spell::TriggerGlobalCooldown().
| void SpellHistory::AtExitCombat | ( | ) |
Definition at line 1152 of file SpellHistory.cpp.
References _categoryCooldowns, CooldownEventOnLeaveCombat, DIFFICULTY_NONE, SendCooldownEvent(), sSpellCategoryStore, and sSpellMgr.
Referenced by Unit::AtExitCombat().
| void SpellHistory::CancelGlobalCooldown | ( | SpellInfo const * | spellInfo | ) |
Definition at line 1030 of file SpellHistory.cpp.
References _globalCooldowns, and SpellInfo::StartRecoveryCategory.
Referenced by Spell::CancelGlobalCooldown().
| void SpellHistory::ConsumeCharge | ( | uint32 | chargeCategoryId | ) |
Definition at line 834 of file SpellHistory.cpp.
References _categoryCharges, _owner, GetChargeRecoveryTime(), GetMaxCharges(), Unit::HasAuraTypeWithMiscvalue(), SPELL_AURA_IGNORE_SPELL_CHARGE_COOLDOWN, and sSpellCategoryStore.
Referenced by HandleCooldowns().
|
private |
Definition at line 1091 of file SpellHistory.cpp.
References _categoryCooldowns, and _spellCooldowns.
Referenced by ModifySpellCooldown(), ResetCooldown(), and Update().
Definition at line 982 of file SpellHistory.cpp.
References _owner, SpellCategoryEntry::ChargeRecoveryTime, CooldownInDays, Unit::GetAuraEffectsByType(), SpellCategoryEntry::GetFlags(), Unit::GetTotalAuraModifierByMiscValue(), Unit::GetTotalAuraMultiplierByMiscValue(), Unit::HasAuraType(), Unit::HasAuraTypeWithMiscvalue(), IgnoreForModTimeRate, Unit::m_unitData, SPELL_AURA_CHARGE_RECOVERY_AFFECTED_BY_HASTE, SPELL_AURA_CHARGE_RECOVERY_AFFECTED_BY_HASTE_REGEN, SPELL_AURA_CHARGE_RECOVERY_MOD, SPELL_AURA_CHARGE_RECOVERY_MULTIPLIER, SPELL_AURA_MOD_CHARGE_RECOVERY_BY_TYPE_MASK, SPELL_AURA_MOD_CHARGE_RECOVERY_RATE, SPELL_AURA_MOD_CHARGE_RECOVERY_RATE_BY_TYPE_MASK, sSpellCategoryStore, and SpellCategoryEntry::TypeMask.
Referenced by ConsumeCharge().
|
static |
Definition at line 1111 of file SpellHistory.cpp.
References ASSERT, SpellInfo::CategoryRecoveryTime, SpellInfo::GetCategory(), SpellInfo::Id, SpellInfo::RecoveryTime, and sObjectMgr.
Referenced by spell_dh_darkglare_boon::HandleEffectRemove(), HasCooldown(), Player::RemoveArenaSpellCooldowns(), SendCooldownEvent(), StartCooldown(), and spell_sha_unrelenting_storms::Trigger().
Definition at line 971 of file SpellHistory.cpp.
References _owner, Unit::GetTotalAuraModifierByMiscValue(), SpellCategoryEntry::MaxCharges, SPELL_AURA_MOD_MAX_CHARGES, and sSpellCategoryStore.
Referenced by ConsumeCharge(), and HasCharge().
|
private |
Definition at line 1075 of file SpellHistory.cpp.
References _owner, and WorldObject::GetCharmerOrOwnerPlayerOrPlayerItself().
Referenced by LockSpellSchool(), ModifySpellCooldown(), ResetAllCharges(), ResetCharges(), ResetCooldown(), SendClearCooldowns(), SendCooldownEvent(), SendSetSpellCharges(), StartCooldown(), UpdateChargeRecoveryRate(), and UpdateCooldownRecoveryRate().
| SpellHistory::Duration SpellHistory::GetRemainingCategoryCooldown | ( | SpellInfo const * | spellInfo | ) | const |
Definition at line 759 of file SpellHistory.cpp.
References SpellInfo::GetCategory(), and GetRemainingCategoryCooldown().
| SpellHistory::Duration SpellHistory::GetRemainingCategoryCooldown | ( | uint32 | categoryId | ) | const |
Definition at line 740 of file SpellHistory.cpp.
References _categoryCooldowns.
Referenced by GetRemainingCategoryCooldown(), and spell_gen_trainer_heal_cooldown::UpdateReviveBattlePetCooldown().
| SpellHistory::Duration SpellHistory::GetRemainingCooldown | ( | SpellInfo const * | spellInfo | ) | const |
Definition at line 709 of file SpellHistory.cpp.
References _categoryCooldowns, _spellCooldowns, SpellInfo::GetCategory(), and SpellInfo::Id.
Referenced by Player::ApplyEquipCooldown(), boss_the_candle_king::GetCooldownOfSpell(), Aura::HandleAuraSpecificMods(), LockSpellSchool(), DuelResetScript::ResetSpellCooldowns(), and boss_general_bjarngrim::UpdateAI().
| SpellHistory::Duration SpellHistory::GetRemainingGlobalCooldown | ( | SpellInfo const * | spellInfo | ) | const |
Definition at line 1035 of file SpellHistory.cpp.
References _globalCooldowns, and SpellInfo::StartRecoveryCategory.
Referenced by Player::CanExecutePendingSpellCastRequest(), and Player::CanRequestSpellCast().
| void SpellHistory::HandleCooldowns | ( | SpellInfo const * | spellInfo, |
| uint32 | itemId, | ||
| Spell * | spell = nullptr |
||
| ) |
Definition at line 244 of file SpellHistory.cpp.
References _owner, SpellInfo::ChargeCategoryId, ConsumeCharge(), Unit::HasAuraTypeWithAffectMask(), SpellInfo::IsCooldownStartedOnEvent(), SpellInfo::IsCooldownStartedOnEventAfterCombat(), Spell::IsIgnoringCooldowns(), Unit::IsInCombat(), SpellInfo::IsPassive(), SendCooldownEvent(), SPELL_AURA_IGNORE_SPELL_COOLDOWN, and StartCooldown.
Referenced by Spell::SendSpellCooldown().
| bool SpellHistory::HasCharge | ( | uint32 | chargeCategoryId | ) | const |
Definition at line 957 of file SpellHistory.cpp.
References _categoryCharges, GetMaxCharges(), and sSpellCategoryStore.
Referenced by spell_sha_lava_burst::EnsureLavaSurgeCanBeImmediatelyConsumed(), and IsReady().
Definition at line 678 of file SpellHistory.cpp.
References _categoryCooldowns, _owner, _spellCooldowns, SpellInfo::CooldownAuraSpellId, GetCooldownDurations(), Unit::HasAura(), Unit::HasAuraTypeWithAffectMask(), SpellInfo::Id, and SPELL_AURA_IGNORE_SPELL_COOLDOWN.
Referenced by Spell::CheckCast(), Spell::EffectCastButtons(), Spell::EffectStuck(), Aura::HandleAuraSpecificMods(), WorldSession::HandleAzeriteEssenceActivateEssence(), WorldSession::HandlePetActionHelper(), WorldSession::HandlePetCastSpellOpcode(), WorldSession::HandleTraitsCommitConfig(), HasCooldown(), Player::InitializeSelfResurrectionSpells(), IsReady(), Player::LearnTalent(), gunship_npc_AI::TriggerBurningPitch(), and npc_gunship_rocketeer::UpdateAI().
Definition at line 697 of file SpellHistory.cpp.
References _owner, Map::GetDifficultyID(), WorldObject::GetMap(), HasCooldown(), and sSpellMgr.
| bool SpellHistory::HasCooldownOnHold | ( | uint32 | spellId | ) | const |
Definition at line 702 of file SpellHistory.cpp.
References _spellCooldowns.
Referenced by Spell::CheckCast().
| bool SpellHistory::HasGlobalCooldown | ( | SpellInfo const * | spellInfo | ) | const |
Definition at line 1019 of file SpellHistory.cpp.
References _globalCooldowns, and SpellInfo::StartRecoveryCategory.
Referenced by Spell::CheckPetCast(), Spell::HasGlobalCooldown(), PetAI::UpdateAI(), and PlayerAI::VerifySpellCast().
|
inline |
Definition at line 199 of file SpellHistory.h.
Definition at line 263 of file SpellHistory.cpp.
References SpellInfo::ChargeCategoryId, SpellInfo::GetSchoolMask(), SpellInfo::HasAttribute(), HasCharge(), HasCooldown(), IsSchoolLocked(), SpellInfo::PreventionType, SPELL_ATTR9_IGNORE_SCHOOL_LOCKOUT, and SPELL_PREVENTION_TYPE_SILENCE.
Referenced by Spell::CheckCast(), and PetAI::UpdateAI().
| bool SpellHistory::IsSchoolLocked | ( | SpellSchoolMask | schoolMask | ) | const |
Definition at line 823 of file SpellHistory.cpp.
References _schoolLockouts, and MAX_SPELL_SCHOOL.
Referenced by IsReady().
| template void SpellHistory::LoadFromDB< Pet > | ( | PreparedQueryResult | cooldownsResult, |
| PreparedQueryResult | chargesResult | ||
| ) |
Definition at line 147 of file SpellHistory.cpp.
References _categoryCharges, _categoryCooldowns, _spellCooldowns, and SpellHistory::CooldownEntry::CategoryId.
Referenced by Player::LoadFromDB().
| void SpellHistory::LockSpellSchool | ( | SpellSchoolMask | schoolMask, |
| Duration | lockoutTime | ||
| ) |
Definition at line 764 of file SpellHistory.cpp.
References _owner, _schoolLockouts, AddCooldown(), WorldPackets::Spells::SpellCooldown::Caster, WorldPackets::Spells::SpellCooldown::Flags, Map::GetDifficultyID(), BaseEntity::GetGUID(), WorldObject::GetMap(), GetPlayerOwner(), GetRemainingCooldown(), SpellInfo::GetSchoolMask(), SpellInfo::HasAttribute(), SpellInfo::IsCooldownStartedOnEvent(), Creature::m_spells, MAX_SPELL_SCHOOL, PETSPELL_REMOVED, PLAYERSPELL_REMOVED, SpellInfo::PreventionType, SPELL_ATTR9_IGNORE_SCHOOL_LOCKOUT, SPELL_COOLDOWN_FLAG_LOSS_OF_CONTROL_UI, SPELL_PREVENTION_TYPE_SILENCE, WorldPackets::Spells::SpellCooldown::SpellCooldowns, sSpellMgr, Object::ToCreature(), Unit::ToPet(), Object::ToPlayer(), and WorldPackets::Spells::SpellCooldown::Write().
Referenced by Spell::EffectInterruptCast().
Definition at line 856 of file SpellHistory.cpp.
References _categoryCharges, SendSetSpellCharges(), and sSpellCategoryStore.
Referenced by spell_rog_deepening_shadows::HandleProc(), and ModifyCooldown().
| void SpellHistory::ModifyCooldown | ( | SpellInfo const * | spellInfo, |
| Duration | cooldownMod, | ||
| bool | withoutCategoryCooldown = false |
||
| ) |
Definition at line 638 of file SpellHistory.cpp.
References SpellInfo::ChargeCategoryId, SpellInfo::Id, ModifyChargeRecoveryTime(), and ModifySpellCooldown().
| void SpellHistory::ModifyCooldown | ( | uint32 | spellId, |
| Duration | cooldownMod, | ||
| bool | withoutCategoryCooldown = false |
||
| ) |
Definition at line 632 of file SpellHistory.cpp.
References _owner, Map::GetDifficultyID(), WorldObject::GetMap(), ModifyCooldown(), and sSpellMgr.
Referenced by Spell::EffectModifyCooldown(), spell_mage_ethereal_blink_triggered::FilterTargets(), spell_evo_causality_pyre::HandleCooldown(), spell_sha_chain_lightning_crash_lightning::HandleCooldownReduction(), spell_warr_rumbling_earth::HandleCooldownReduction(), spell_dh_cycle_of_hatred::HandleCycleOfHatred(), spell_pri_protector_of_the_frail::HandleEffectHit(), spell_pal_crusader_might::HandleEffectProc(), spell_pal_fist_of_justice::HandleEffectProc(), spell_pal_righteous_protector::HandleEffectProc(), spell_dh_cycle_of_binding::HandleEffectProc(), spell_hun_scrappy::HandleEffectProc(), spell_warl_cull_the_weak::HandleEffectProc(), spell_pri_heavens_wrath::HandleEffectProc(), spell_dh_darkglare_boon::HandleEffectRemove(), spell_hun_steady_shot::HandleOnHit(), spell_hun_take_aim::HandleOnHit(), spell_hun_hunting_party::HandleProc(), spell_rog_restless_blades::HandleProc(), spell_warr_anger_management_proc::HandleProc(), spell_hun_focused_aim::HandleProc(), ModifyCooldown(), spell_pri_holy_words_base::ModifyCooldown(), spell_evo_causality_disintegrate::OnTick(), spell_pri_holy_word_salvation_cooldown_reduction::ReduceCooldown(), spell_sha_ashen_catalyst::ReduceLavaLashCooldown(), spell_pri_train_of_thought::ReducePenanceCooldown(), spell_pri_train_of_thought::ReducePowerWordShieldCooldown(), and spell_gen_trainer_heal_cooldown::UpdateReviveBattlePetCooldown().
|
inline |
Definition at line 128 of file SpellHistory.h.
Referenced by Spell::EffectModifyCooldowns(), and Spell::EffectModifyCooldownsByCategory().
|
private |
Definition at line 578 of file SpellHistory.cpp.
References _owner, WorldPackets::Spells::ModifyCooldown::DeltaTime, EraseCooldown(), GetPlayerOwner(), WorldPackets::Spells::ModifyCooldown::IsPet, WorldPackets::Spells::ModifyCooldown::SkipCategory, WorldPackets::Spells::ModifyCooldown::SpellID, and WorldPackets::Spells::ModifyCooldown::Write().
|
private |
Definition at line 569 of file SpellHistory.cpp.
References _spellCooldowns, and ModifySpellCooldown().
Referenced by ModifyCooldown(), and ModifySpellCooldown().
|
delete |
|
delete |
| void SpellHistory::PauseCooldowns | ( | ) |
Definition at line 1050 of file SpellHistory.cpp.
References _pauseTime.
| void SpellHistory::ResetAllCharges | ( | ) |
Definition at line 945 of file SpellHistory.cpp.
References _categoryCharges, _owner, GetPlayerOwner(), WorldPackets::Spells::ClearAllSpellCharges::IsPet, and WorldPackets::Spells::ClearAllSpellCharges::Write().
Referenced by misc_commandscript::HandleCooldownCommand().
| void SpellHistory::ResetAllCooldowns | ( | ) |
Definition at line 673 of file SpellHistory.cpp.
References ResetCooldowns().
Referenced by CreatureAI::_EnterEvadeMode(), and misc_commandscript::HandleCooldownCommand().
| void SpellHistory::ResetCharges | ( | uint32 | chargeCategoryId | ) |
Definition at line 928 of file SpellHistory.cpp.
References _categoryCharges, _owner, WorldPackets::Spells::ClearSpellCharges::Category, GetPlayerOwner(), WorldPackets::Spells::ClearSpellCharges::IsPet, and WorldPackets::Spells::ClearSpellCharges::Write().
Referenced by spell_mage_alter_time_aura::AfterRemove(), spell_mage_spontaneous_combustion::HandleCharges(), misc_commandscript::HandleCooldownCommand(), and npc_sparring_partner_enhanced_combat_training_warrior::ResetWarrior().
|
private |
| void SpellHistory::ResetCooldown | ( | uint32 | spellId, |
| bool | update = false |
||
| ) |
Definition at line 647 of file SpellHistory.cpp.
References _spellCooldowns, and ResetCooldown().
Referenced by Spell::_cast(), Spell::cancel(), Spell::finish(), Aura::HandleAuraSpecificMods(), spell_warr_strategist::HandleCooldown(), misc_commandscript::HandleCooldownCommand(), spell_item_rocket_boots::HandleDummy(), spell_mage_cold_snap::HandleDummy(), spell_pal_grand_crusader::HandleEffectProc(), spell_pal_moment_of_glory::HandleOnHit(), spell_warr_victorious_state::HandleOnProc(), spell_dh_unhindered_assault::HandleOnProc(), spell_dh_violent_transformation::HandleOnProc(), spell_pri_epiphany::HandleOnProc(), WorldSession::HandlePetActionHelper(), WorldSession::HandlePetCastSpellOpcode(), spell_dru_gore::HandleProc(), spell_pal_art_of_war::HandleProc(), spell_dh_felblade_cooldown_reset_proc::HandleProc(), spell_hun_surging_shots::HandleProc(), spell_gen_divine_storm_cd_reset::HandleScript(), spell_warr_devastator::OnProc(), ResetCooldown(), spell_dru_berserk::ResetCooldowns(), and spell_sha_molten_thunder_sundering::RollReset().
|
inline |
Definition at line 151 of file SpellHistory.h.
Referenced by Unit::AtEndOfEncounter(), spell_dh_chaotic_transformation::HandleCooldown(), Player::RemoveArenaSpellCooldowns(), ResetAllCooldowns(), and DuelResetScript::ResetSpellCooldowns().
| void SpellHistory::RestoreCharge | ( | uint32 | chargeCategoryId | ) |
Definition at line 917 of file SpellHistory.cpp.
References _categoryCharges, and SendSetSpellCharges().
Referenced by Spell::_cast(), Spell::EffectModifySpellCharges(), spell_sha_lava_burst::EnsureLavaSurgeCanBeImmediatelyConsumed(), spell_torghast_dimensional_blade::FilterTargets(), spell_dh_moment_of_craving::HandleAfterRemove(), spell_mage_cold_snap::HandleDummy(), spell_dh_violent_transformation::HandleOnProc(), spell_dk_crimson_scourge::HandleProc(), spell_warr_tactician::HandleProc(), spell_warr_raging_blow_cooldown_reset::HandleResetCooldown(), spell_dh_restless_hunter::OnRemove(), spell_sha_lava_surge_proc::ResetCooldown(), and spell_warl_shadowburn::TryEnergize().
| void SpellHistory::RestoreCooldownStateAfterDuel | ( | ) |
Definition at line 1169 of file SpellHistory.cpp.
References _owner, _spellCooldowns, _spellCooldownsBeforeDuel, WorldPackets::Spells::SpellCooldown::Caster, SpellInfo::CategoryRecoveryTime, DIFFICULTY_NONE, WorldPackets::Spells::SpellCooldown::Flags, BaseEntity::GetGUID(), IN_MILLISECONDS, MINUTE, SpellInfo::RecoveryTime, SPELL_COOLDOWN_FLAG_INCLUDE_EVENT_COOLDOWNS, WorldPackets::Spells::SpellCooldown::SpellCooldowns, sSpellMgr, Object::ToPlayer(), and WorldPackets::Spells::SpellCooldown::Write().
Referenced by DuelResetScript::OnDuelEnd().
| void SpellHistory::ResumeCooldowns | ( | ) |
Definition at line 1055 of file SpellHistory.cpp.
References _categoryCharges, _pauseTime, _spellCooldowns, and Update().
| void SpellHistory::SaveCooldownStateBeforeDuel | ( | ) |
Definition at line 1164 of file SpellHistory.cpp.
References _spellCooldowns, and _spellCooldownsBeforeDuel.
Referenced by DuelResetScript::OnDuelStart().
| template void SpellHistory::SaveToDB< Pet > | ( | CharacterDatabaseTransaction | trans | ) |
Definition at line 182 of file SpellHistory.cpp.
References _categoryCharges, _owner, _spellCooldowns, and CharacterDatabase.
Referenced by Pet::SavePetToDB(), and Player::SaveToDB().
|
private |
Definition at line 1080 of file SpellHistory.cpp.
References _owner, GetPlayerOwner(), WorldPackets::Spells::ClearCooldowns::IsPet, WorldPackets::Spells::ClearCooldowns::SpellID, and WorldPackets::Spells::ClearCooldowns::Write().
| void SpellHistory::SendCooldownEvent | ( | SpellInfo const * | spellInfo, |
| uint32 | itemId = 0, |
||
| Spell * | spell = nullptr, |
||
| bool | startCooldown = true |
||
| ) |
Definition at line 526 of file SpellHistory.cpp.
References _categoryCooldowns, _owner, SpellInfo::GetCategory(), GetCooldownDurations(), Map::GetDifficultyID(), WorldObject::GetMap(), GetPlayerOwner(), SpellInfo::Id, sSpellMgr, StartCooldown, and WorldPackets::Spells::CooldownEvent::Write().
Referenced by Aura::_UnapplyForTarget(), AtExitCombat(), HandleCooldowns(), Unit::RemoveGameObjectImpl(), Unit::SetMinion(), and Totem::UnSummon().
|
private |
Definition at line 1097 of file SpellHistory.cpp.
References _owner, WorldPackets::Spells::SetSpellCharges::Category, WorldPackets::Spells::SetSpellCharges::ConsumedCharges, GetPlayerOwner(), WorldPackets::Spells::SetSpellCharges::IsPet, WorldPackets::Spells::SetSpellCharges::NextRecoveryTime, and WorldPackets::Spells::SetSpellCharges::Write().
Referenced by ModifyChargeRecoveryTime(), and RestoreCharge().
| void SpellHistory::StartCooldown | ( | SpellInfo const * | spellInfo, |
| uint32 | itemId, | ||
| Spell * | spell = nullptr, |
||
| bool | onHold = false, |
||
| Optional< Duration > | forcedCooldown = {} |
||
| ) |
Definition at line 381 of file SpellHistory.cpp.
References _owner, AddCooldown(), WorldPackets::Spells::SpellCooldown::Caster, Cooldown, CooldownInDays, WorldPackets::Spells::SpellCooldown::Flags, Unit::GetAuraEffectsByType(), GetCooldownDurations(), SpellCategoryEntry::GetFlags(), BaseEntity::GetGUID(), GetPlayerOwner(), WorldObject::GetSpellModOwner(), Unit::GetTotalAuraModifier(), Unit::GetTotalAuraModifierByMiscValue(), SpellInfo::HasAttribute(), Unit::HasAuraTypeWithAffectMask(), SpellInfo::HasLabel(), Player::HasSpell(), SpellInfo::Id, IgnoreDuringCooldownTimeRateCalculation, Unit::m_unitData, SPELL_ATTR6_IGNORE_FOR_MOD_TIME_RATE, SPELL_ATTR6_NO_CATEGORY_COOLDOWN_MODS, SPELL_AURA_MOD_COOLDOWN, SPELL_AURA_MOD_COOLDOWN_BY_HASTE_REGEN, SPELL_AURA_MOD_RECOVERY_RATE, SPELL_AURA_MOD_RECOVERY_RATE_BY_SPELL_LABEL, SPELL_AURA_MOD_SPELL_CATEGORY_COOLDOWN, SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE, SPELL_COOLDOWN_FLAG_NONE, WorldPackets::Spells::SpellCooldown::SpellCooldowns, sSpellCategoryStore, sWorld, and WorldPackets::Spells::SpellCooldown::Write().
Referenced by Aura::_ApplyForTarget(), Unit::AddGameObject(), spell_dh_glide::HandleCast(), spell_evo_glide::HandleCast(), spell_sha_downpour::HandleCooldown(), Unit::SetMinion(), and spell_gen_trainer_heal_cooldown::UpdateReviveBattlePetCooldown().
| void SpellHistory::Update | ( | ) |
Definition at line 220 of file SpellHistory.cpp.
References _categoryCharges, _categoryCooldowns, _spellCooldowns, and EraseCooldown().
Referenced by ResumeCooldowns().
| void SpellHistory::UpdateChargeRecoveryRate | ( | uint32 | chargeCategoryId, |
| float | modChange, | ||
| bool | apply | ||
| ) |
Definition at line 880 of file SpellHistory.cpp.
References _categoryCharges, WorldPackets::Spells::UpdateChargeCategoryCooldown::Category, GetPlayerOwner(), WorldPackets::Spells::UpdateChargeCategoryCooldown::ModChange, and WorldPackets::Spells::UpdateChargeCategoryCooldown::Write().
Referenced by AuraEffect::HandleModChargeRecoveryRate().
|
private |
Definition at line 608 of file SpellHistory.cpp.
References GetPlayerOwner(), WorldPackets::Spells::UpdateCooldown::ModChange, WorldPackets::Spells::UpdateCooldown::SpellID, and WorldPackets::Spells::UpdateCooldown::Write().
|
inline |
Definition at line 140 of file SpellHistory.h.
Referenced by AuraEffect::HandleModRecoveryRate(), and AuraEffect::HandleModRecoveryRateBySpellLabel().
| void SpellHistory::WritePacket | ( | WorldPackets::Pet::PetSpells * | petSpells | ) | const |
Definition at line 334 of file SpellHistory.cpp.
References _categoryCharges, _spellCooldowns, WorldPackets::Pet::PetSpellCooldown::Category, WorldPackets::Pet::PetSpellCooldown::CategoryDuration, WorldPackets::Pet::PetSpellHistory::CategoryID, WorldPackets::Pet::PetSpellHistory::ConsumedCharges, WorldPackets::Pet::PetSpells::Cooldowns, WorldPackets::Pet::PetSpellCooldown::Duration, WorldPackets::Pet::PetSpellHistory::RecoveryTime, WorldPackets::Pet::PetSpells::SpellHistory, and WorldPackets::Pet::PetSpellCooldown::SpellID.
| void SpellHistory::WritePacket | ( | WorldPackets::Spells::SendSpellCharges * | sendSpellCharges | ) | const |
| void SpellHistory::WritePacket | ( | WorldPackets::Spells::SendSpellHistory * | sendSpellHistory | ) | const |
Definition at line 278 of file SpellHistory.cpp.
References _spellCooldowns, WorldPackets::Spells::SpellHistoryEntry::Category, WorldPackets::Spells::SpellHistoryEntry::CategoryRecoveryTime, WorldPackets::Spells::SendSpellHistory::Entries, WorldPackets::Spells::SpellHistoryEntry::ItemID, WorldPackets::Spells::SpellHistoryEntry::OnHold, WorldPackets::Spells::SpellHistoryEntry::RecoveryTime, and WorldPackets::Spells::SpellHistoryEntry::SpellID.
Referenced by Player::CharmSpellInitialize(), Player::PetSpellInitialize(), Player::PossessSpellInitialize(), Player::SendInitialPacketsBeforeAddToMap(), and Player::VehicleSpellInitialize().
|
private |
Definition at line 226 of file SpellHistory.h.
Referenced by ConsumeCharge(), HasCharge(), LoadFromDB(), ModifyChargeRecoveryTime(), ResetAllCharges(), ResetCharges(), RestoreCharge(), ResumeCooldowns(), SaveToDB(), Update(), UpdateChargeRecoveryRate(), WritePacket(), and WritePacket().
|
private |
Definition at line 224 of file SpellHistory.h.
Referenced by AddCooldown(), AtExitCombat(), EraseCooldown(), GetRemainingCategoryCooldown(), GetRemainingCooldown(), HasCooldown(), LoadFromDB(), SendCooldownEvent(), and Update().
|
private |
Definition at line 227 of file SpellHistory.h.
Referenced by AddGlobalCooldown(), CancelGlobalCooldown(), GetRemainingGlobalCooldown(), and HasGlobalCooldown().
|
private |
Definition at line 221 of file SpellHistory.h.
Referenced by ConsumeCharge(), GetChargeRecoveryTime(), GetMaxCharges(), GetPlayerOwner(), HandleCooldowns(), HasCooldown(), HasCooldown(), LockSpellSchool(), ModifyCooldown(), ModifySpellCooldown(), ResetAllCharges(), ResetCharges(), ResetCooldown(), RestoreCooldownStateAfterDuel(), SaveToDB(), SendClearCooldowns(), SendCooldownEvent(), SendSetSpellCharges(), and StartCooldown().
Definition at line 228 of file SpellHistory.h.
Referenced by PauseCooldowns(), and ResumeCooldowns().
|
private |
Definition at line 225 of file SpellHistory.h.
Referenced by IsSchoolLocked(), and LockSpellSchool().
|
private |
Definition at line 222 of file SpellHistory.h.
Referenced by AddCooldown(), EraseCooldown(), GetRemainingCooldown(), HasCooldown(), HasCooldownOnHold(), LoadFromDB(), ModifySpellCooldown(), ResetCooldown(), RestoreCooldownStateAfterDuel(), ResumeCooldowns(), SaveCooldownStateBeforeDuel(), SaveToDB(), Update(), WritePacket(), and WritePacket().
|
private |
Definition at line 223 of file SpellHistory.h.
Referenced by RestoreCooldownStateAfterDuel(), and SaveCooldownStateBeforeDuel().