![]() |
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, Item const *item, Spell *spell=nullptr) |
| 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 |
| 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 | SaveCooldownStateBeforeDuel () |
| void | RestoreCooldownStateAfterDuel () |
Static Public Member Functions | |
| static void | GetCooldownDurations (SpellInfo const *spellInfo, uint32 itemId, Duration *cooldown, uint32 *categoryId, Duration *categoryCooldown) |
Static Public Attributes | |
| static Duration const | InfinityCooldownDelay = Seconds(MONTH) |
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 > const &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 141 of file SpellHistory.cpp.
|
default |
|
delete |
|
delete |
| void SpellHistory::AddCooldown | ( | uint32 | spellId, |
| uint32 | itemId, | ||
| TimePoint | cooldownEnd, | ||
| uint32 | categoryId, | ||
| TimePoint | categoryEnd, | ||
| bool | onHold = false |
||
| ) |
Definition at line 575 of file SpellHistory.cpp.
| void SpellHistory::CancelGlobalCooldown | ( | SpellInfo const * | spellInfo | ) |
| void SpellHistory::ConsumeCharge | ( | uint32 | chargeCategoryId | ) |
Definition at line 851 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 999 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 1127 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 988 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1091 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| SpellHistory::Duration SpellHistory::GetRemainingCategoryCooldown | ( | SpellInfo const * | spellInfo | ) | const |
| SpellHistory::Duration SpellHistory::GetRemainingCategoryCooldown | ( | uint32 | categoryId | ) | const |
| SpellHistory::Duration SpellHistory::GetRemainingCooldown | ( | SpellInfo const * | spellInfo | ) | const |
Definition at line 737 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| SpellHistory::Duration SpellHistory::GetRemainingGlobalCooldown | ( | SpellInfo const * | spellInfo | ) | const |
| void SpellHistory::HandleCooldowns | ( | SpellInfo const * | spellInfo, |
| Item const * | item, | ||
| Spell * | spell = nullptr |
||
| ) |
Definition at line 245 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool SpellHistory::HasCharge | ( | uint32 | chargeCategoryId | ) | const |
Definition at line 974 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 713 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool SpellHistory::HasGlobalCooldown | ( | SpellInfo const * | spellInfo | ) | const |
|
inline |
Definition at line 201 of file SpellHistory.h.
Definition at line 279 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool SpellHistory::IsSchoolLocked | ( | SpellSchoolMask | schoolMask | ) | const |
| template void SpellHistory::LoadFromDB< Pet > | ( | PreparedQueryResult | cooldownsResult, |
| PreparedQueryResult | chargesResult | ||
| ) |
| void SpellHistory::LockSpellSchool | ( | SpellSchoolMask | schoolMask, |
| Duration | lockoutTime | ||
| ) |
Definition at line 781 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 873 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::ModifyCooldown | ( | uint32 | spellId, |
| Duration | cooldownMod, | ||
| bool | withoutCategoryCooldown = false |
||
| ) |
Definition at line 656 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
|
private |
|
private |
Definition at line 593 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
delete |
|
delete |
| void SpellHistory::PauseCooldowns | ( | ) |
Definition at line 1067 of file SpellHistory.cpp.
| void SpellHistory::ResetAllCharges | ( | ) |
Definition at line 962 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::ResetAllCooldowns | ( | ) |
Definition at line 697 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::ResetCharges | ( | uint32 | chargeCategoryId | ) |
Definition at line 945 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
| void SpellHistory::ResetCooldown | ( | uint32 | spellId, |
| bool | update = false |
||
| ) |
Definition at line 671 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
| void SpellHistory::RestoreCharge | ( | uint32 | chargeCategoryId | ) |
Definition at line 934 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::RestoreCooldownStateAfterDuel | ( | ) |
Definition at line 1173 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::ResumeCooldowns | ( | ) |
| void SpellHistory::SaveCooldownStateBeforeDuel | ( | ) |
| template void SpellHistory::SaveToDB< Pet > | ( | CharacterDatabaseTransaction | trans | ) |
|
private |
Definition at line 1096 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::SendCooldownEvent | ( | SpellInfo const * | spellInfo, |
| uint32 | itemId = 0, |
||
| Spell * | spell = nullptr, |
||
| bool | startCooldown = true |
||
| ) |
Definition at line 550 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1113 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::StartCooldown | ( | SpellInfo const * | spellInfo, |
| uint32 | itemId, | ||
| Spell * | spell = nullptr, |
||
| bool | onHold = false, |
||
| Optional< Duration > | forcedCooldown = {} |
||
| ) |
Definition at line 397 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::Update | ( | ) |
Definition at line 221 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::UpdateChargeRecoveryRate | ( | uint32 | chargeCategoryId, |
| float | modChange, | ||
| bool | apply | ||
| ) |
Definition at line 897 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
|
inline |
| void SpellHistory::WritePacket | ( | WorldPackets::Pet::PetSpells * | petSpells | ) | const |
Definition at line 350 of file SpellHistory.cpp.
| void SpellHistory::WritePacket | ( | WorldPackets::Spells::SendSpellCharges * | sendSpellCharges | ) | const |
Definition at line 328 of file SpellHistory.cpp.
| void SpellHistory::WritePacket | ( | WorldPackets::Spells::SendSpellHistory * | sendSpellHistory | ) | const |
|
private |
Definition at line 226 of file SpellHistory.h.
|
private |
Definition at line 224 of file SpellHistory.h.
|
private |
Definition at line 227 of file SpellHistory.h.
|
private |
Definition at line 221 of file SpellHistory.h.
Definition at line 228 of file SpellHistory.h.
|
private |
Definition at line 225 of file SpellHistory.h.
|
private |
Definition at line 222 of file SpellHistory.h.
|
private |
Definition at line 223 of file SpellHistory.h.
|
static |
Definition at line 116 of file SpellHistory.h.