![]() |
TrinityCore
|
#include <SpellHistory.h>
Classes | |
| struct | CooldownEntry |
| struct | PersistenceHelper |
| struct | PersistenceHelper< Pet > |
| struct | PersistenceHelper< Player > |
Public Types | |
| typedef std::chrono::system_clock | Clock |
| typedef std::unordered_map< uint32, CooldownEntry > | CooldownStorageType |
| typedef std::unordered_map< uint32, CooldownEntry * > | CategoryCooldownStorageType |
| typedef std::unordered_map< uint32, Clock::time_point > | GlobalCooldownStorageType |
Public Member Functions | |
| SpellHistory (Unit *owner) | |
| template<class OwnerType > | |
| void | LoadFromDB (PreparedQueryResult cooldownsResult) |
| 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, bool ignoreCategoryCooldown=false) const |
| template<class OwnerType > | |
| void | WritePacket (WorldPacket &packet) const |
| void | WritePacket (WorldPackets::Spells::InitialSpells *initialSpells) const |
| void | StartCooldown (SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr, bool onHold=false) |
| void | SendCooldownEvent (SpellInfo const *spellInfo, uint32 itemId=0, Spell *spell=nullptr, bool startCooldown=true) |
| template<class Type , class Period > | |
| void | AddCooldown (uint32 spellId, uint32 itemId, std::chrono::duration< Type, Period > cooldownDuration) |
| void | AddCooldown (uint32 spellId, uint32 itemId, Clock::time_point cooldownEnd, uint32 categoryId, Clock::time_point categoryEnd, bool onHold=false) |
| void | ModifyCooldown (uint32 spellId, int32 cooldownModMs) |
| void | ResetCooldown (uint32 spellId, bool update=false) |
| void | ResetCooldown (CooldownStorageType::iterator &itr, bool update=false) |
| template<typename Predicate > | |
| void | ResetCooldowns (Predicate predicate, bool update=false) |
| void | ResetAllCooldowns () |
| bool | HasCooldown (SpellInfo const *spellInfo, uint32 itemId=0, bool ignoreCategoryCooldown=false) const |
| bool | HasCooldown (uint32 spellId, uint32 itemId=0, bool ignoreCategoryCooldown=false) const |
| uint32 | GetRemainingCooldown (SpellInfo const *spellInfo) const |
| void | LockSpellSchool (SpellSchoolMask schoolMask, uint32 lockoutTime) |
| bool | IsSchoolLocked (SpellSchoolMask schoolMask) const |
| bool | HasGlobalCooldown (SpellInfo const *spellInfo) const |
| void | AddGlobalCooldown (SpellInfo const *spellInfo, uint32 duration) |
| void | CancelGlobalCooldown (SpellInfo const *spellInfo) |
| void | BuildCooldownPacket (WorldPacket &data, uint8 flags, uint32 spellId, uint32 cooldown) const |
| CooldownStorageType::size_type | GetCooldownsSizeForPacket () const |
| void | SaveCooldownStateBeforeDuel () |
| void | RestoreCooldownStateAfterDuel () |
| template<> | |
| void | WritePacket (WorldPacket &packet) const |
Static Public Member Functions | |
| static void | GetCooldownDurations (SpellInfo const *spellInfo, uint32 itemId, int32 *cooldown, uint32 *categoryId, int32 *categoryCooldown) |
Static Public Attributes | |
| static Clock::duration const | InfinityCooldownDelay = std::chrono::duration_cast<SpellHistory::Clock::duration>(std::chrono::seconds(MONTH)) |
| static Clock::duration const | InfinityCooldownDelayCheck = std::chrono::duration_cast<SpellHistory::Clock::duration>(std::chrono::seconds(MONTH / 2)) |
Private Types | |
| typedef std::unordered_map< uint32, uint32 > | PacketCooldowns |
Private Member Functions | |
| Player * | GetPlayerOwner () const |
| void | SendClearCooldowns (std::vector< int32 > const &cooldowns) const |
| CooldownStorageType::iterator | EraseCooldown (CooldownStorageType::iterator itr) |
| void | BuildCooldownPacket (WorldPacket &data, uint8 flags, PacketCooldowns const &cooldowns) const |
Private Attributes | |
| Unit * | _owner |
| CooldownStorageType | _spellCooldowns |
| CooldownStorageType | _spellCooldownsBeforeDuel |
| CategoryCooldownStorageType | _categoryCooldowns |
| Clock::time_point | _schoolLockouts [MAX_SPELL_SCHOOL] |
| GlobalCooldownStorageType | _globalCooldowns |
Definition at line 48 of file SpellHistory.h.
| typedef std::unordered_map<uint32 , CooldownEntry*> SpellHistory::CategoryCooldownStorageType |
Definition at line 64 of file SpellHistory.h.
| typedef std::chrono::system_clock SpellHistory::Clock |
Definition at line 51 of file SpellHistory.h.
| typedef std::unordered_map<uint32 , CooldownEntry> SpellHistory::CooldownStorageType |
Definition at line 63 of file SpellHistory.h.
| typedef std::unordered_map<uint32 , Clock::time_point> SpellHistory::GlobalCooldownStorageType |
Definition at line 65 of file SpellHistory.h.
|
private |
Definition at line 153 of file SpellHistory.h.
|
inlineexplicit |
Definition at line 67 of file SpellHistory.h.
| void SpellHistory::AddCooldown | ( | uint32 | spellId, |
| uint32 | itemId, | ||
| Clock::time_point | cooldownEnd, | ||
| uint32 | categoryId, | ||
| Clock::time_point | categoryEnd, | ||
| bool | onHold = false |
||
| ) |
Definition at line 383 of file SpellHistory.cpp.
|
inline |
Definition at line 92 of file SpellHistory.h.
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 579 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
| void SpellHistory::BuildCooldownPacket | ( | WorldPacket & | data, |
| uint8 | flags, | ||
| uint32 | spellId, | ||
| uint32 | cooldown | ||
| ) | const |
Definition at line 608 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::CancelGlobalCooldown | ( | SpellInfo const * | spellInfo | ) |
|
inlineprivate |
|
static |
Definition at line 629 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
|
private |
Definition at line 589 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 482 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::HandleCooldowns | ( | SpellInfo const * | spellInfo, |
| Item const * | item, | ||
| Spell * | spell = nullptr |
||
| ) |
Definition at line 162 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool SpellHistory::HasCooldown | ( | SpellInfo const * | spellInfo, |
| uint32 | itemId = 0, |
||
| bool | ignoreCategoryCooldown = false |
||
| ) | const |
Definition at line 461 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 |
Definition at line 573 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool SpellHistory::IsReady | ( | SpellInfo const * | spellInfo, |
| uint32 | itemId = 0, |
||
| bool | ignoreCategoryCooldown = false |
||
| ) | const |
Definition at line 191 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 |
Definition at line 562 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| template void SpellHistory::LoadFromDB< Pet > | ( | PreparedQueryResult | cooldownsResult | ) |
| void SpellHistory::LockSpellSchool | ( | SpellSchoolMask | schoolMask, |
| uint32 | lockoutTime | ||
| ) |
Definition at line 505 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 445 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::ResetCooldown | ( | CooldownStorageType::iterator & | itr, |
| bool | update = false |
||
| ) |
| void SpellHistory::ResetCooldown | ( | uint32 | spellId, |
| bool | update = false |
||
| ) |
Definition at line 420 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
| void SpellHistory::RestoreCooldownStateAfterDuel | ( | ) |
Definition at line 676 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::SaveCooldownStateBeforeDuel | ( | ) |
| template void SpellHistory::SaveToDB< Pet > | ( | CharacterDatabaseTransaction | trans | ) |
|
private |
Definition at line 594 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 352 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 |
||
| ) |
Definition at line 271 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 142 of file SpellHistory.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void SpellHistory::WritePacket | ( | WorldPacket & | packet | ) | const |
| void SpellHistory::WritePacket | ( | WorldPacket & | packet | ) | const |
Here is the caller graph for this function:| void SpellHistory::WritePacket | ( | WorldPackets::Spells::InitialSpells * | initialSpells | ) | const |
|
private |
Definition at line 159 of file SpellHistory.h.
|
private |
Definition at line 161 of file SpellHistory.h.
|
private |
Definition at line 156 of file SpellHistory.h.
|
private |
Definition at line 160 of file SpellHistory.h.
|
private |
Definition at line 157 of file SpellHistory.h.
|
private |
Definition at line 158 of file SpellHistory.h.
|
static |
Definition at line 85 of file SpellHistory.h.
|
static |
Definition at line 86 of file SpellHistory.h.