![]() |
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 | 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, Clock::time_point > |
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 |
template<class PacketType > | |
void | WritePacket (PacketType *packet) 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, Clock::time_point cooldownEnd, uint32 categoryId, Clock::time_point categoryEnd, bool onHold=false) |
void | ModifyCooldown (uint32 spellId, Duration cooldownMod, bool withoutCategoryCooldown=false) |
void | ModifyCooldown (SpellInfo const *spellInfo, Duration cooldownMod, bool withoutCategoryCooldown=false) |
template<typename Predicate > | |
void | ModifyCoooldowns (Predicate &&predicate, Duration cooldownMod, bool withoutCategoryCooldown=false) |
void | ResetCooldown (uint32 spellId, bool update=false) |
template<typename 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 |
bool | ConsumeCharge (uint32 chargeCategoryId) |
void | ModifyChargeRecoveryTime (uint32 chargeCategoryId, Duration cooldownMod) |
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) |
void | SaveCooldownStateBeforeDuel () |
void | RestoreCooldownStateAfterDuel () |
template<> | |
void | WritePacket (WorldPackets::Spells::SendSpellHistory *sendSpellHistory) const |
template<> | |
void | WritePacket (WorldPackets::Spells::SendSpellCharges *sendSpellCharges) const |
template<> | |
void | WritePacket (WorldPackets::Pet::PetSpells *petSpells) const |
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 | 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) |
Static Private Member Functions | |
static void | GetCooldownDurations (SpellInfo const *spellInfo, uint32 itemId, Duration *cooldown, uint32 *categoryId, Duration *categoryCooldown) |
Definition at line 46 of file SpellHistory.h.
using SpellHistory::CategoryCooldownStorageType = std::unordered_map<uint32 , CooldownEntry*> |
Definition at line 74 of file SpellHistory.h.
using SpellHistory::ChargeEntryCollection = std::deque<ChargeEntry> |
Definition at line 72 of file SpellHistory.h.
using SpellHistory::ChargeStorageType = std::unordered_map<uint32 , ChargeEntryCollection> |
Definition at line 75 of file SpellHistory.h.
using SpellHistory::Clock = std::chrono::system_clock |
Definition at line 49 of file SpellHistory.h.
using SpellHistory::CooldownStorageType = std::unordered_map<uint32 , CooldownEntry> |
Definition at line 73 of file SpellHistory.h.
using SpellHistory::Duration = Milliseconds |
Definition at line 50 of file SpellHistory.h.
using SpellHistory::GlobalCooldownStorageType = std::unordered_map<uint32 , Clock::time_point> |
Definition at line 76 of file SpellHistory.h.
|
explicit |
Definition at line 139 of file SpellHistory.cpp.
|
default |
|
delete |
|
delete |
void SpellHistory::AddCooldown | ( | uint32 | spellId, |
uint32 | itemId, | ||
Clock::time_point | cooldownEnd, | ||
uint32 | categoryId, | ||
Clock::time_point | categoryEnd, | ||
bool | onHold = false |
||
) |
Definition at line 553 of file SpellHistory.cpp.
Definition at line 107 of file SpellHistory.h.
Definition at line 940 of file SpellHistory.cpp.
void SpellHistory::CancelGlobalCooldown | ( | SpellInfo const * | spellInfo | ) |
Definition at line 945 of file SpellHistory.cpp.
bool SpellHistory::ConsumeCharge | ( | uint32 | chargeCategoryId | ) |
Definition at line 802 of file SpellHistory.cpp.
|
inlineprivate |
Definition at line 184 of file SpellHistory.h.
Definition at line 913 of file SpellHistory.cpp.
|
staticprivate |
Definition at line 980 of file SpellHistory.cpp.
Definition at line 902 of file SpellHistory.cpp.
|
private |
Definition at line 950 of file SpellHistory.cpp.
SpellHistory::Duration SpellHistory::GetRemainingCategoryCooldown | ( | SpellInfo const * | spellInfo | ) | const |
Definition at line 730 of file SpellHistory.cpp.
SpellHistory::Duration SpellHistory::GetRemainingCategoryCooldown | ( | uint32 | categoryId | ) | const |
Definition at line 713 of file SpellHistory.cpp.
SpellHistory::Duration SpellHistory::GetRemainingCooldown | ( | SpellInfo const * | spellInfo | ) | const |
Definition at line 690 of file SpellHistory.cpp.
void SpellHistory::HandleCooldowns | ( | SpellInfo const * | spellInfo, |
Item const * | item, | ||
Spell * | spell = nullptr |
||
) |
Definition at line 246 of file SpellHistory.cpp.
void SpellHistory::HandleCooldowns | ( | SpellInfo const * | spellInfo, |
uint32 | itemId, | ||
Spell * | spell = nullptr |
||
) |
Definition at line 251 of file SpellHistory.cpp.
bool SpellHistory::HasCharge | ( | uint32 | chargeCategoryId | ) | const |
Definition at line 888 of file SpellHistory.cpp.
Definition at line 669 of file SpellHistory.cpp.
Definition at line 685 of file SpellHistory.cpp.
bool SpellHistory::HasGlobalCooldown | ( | SpellInfo const * | spellInfo | ) | const |
Definition at line 934 of file SpellHistory.cpp.
Definition at line 278 of file SpellHistory.cpp.
bool SpellHistory::IsSchoolLocked | ( | SpellSchoolMask | schoolMask | ) | const |
Definition at line 791 of file SpellHistory.cpp.
template void SpellHistory::LoadFromDB< Pet > | ( | PreparedQueryResult | cooldownsResult, |
PreparedQueryResult | chargesResult | ||
) |
Definition at line 146 of file SpellHistory.cpp.
void SpellHistory::LockSpellSchool | ( | SpellSchoolMask | schoolMask, |
Duration | lockoutTime | ||
) |
Definition at line 735 of file SpellHistory.cpp.
Definition at line 824 of file SpellHistory.cpp.
void SpellHistory::ModifyCooldown | ( | SpellInfo const * | spellInfo, |
Duration | cooldownMod, | ||
bool | withoutCategoryCooldown = false |
||
) |
Definition at line 616 of file SpellHistory.cpp.
void SpellHistory::ModifyCooldown | ( | uint32 | spellId, |
Duration | cooldownMod, | ||
bool | withoutCategoryCooldown = false |
||
) |
Definition at line 610 of file SpellHistory.cpp.
|
inline |
Definition at line 117 of file SpellHistory.h.
|
private |
Definition at line 580 of file SpellHistory.cpp.
|
private |
Definition at line 571 of file SpellHistory.cpp.
|
delete |
|
delete |
void SpellHistory::ResetAllCharges | ( | ) |
Definition at line 876 of file SpellHistory.cpp.
void SpellHistory::ResetAllCooldowns | ( | ) |
Definition at line 653 of file SpellHistory.cpp.
void SpellHistory::ResetCharges | ( | uint32 | chargeCategoryId | ) |
Definition at line 859 of file SpellHistory.cpp.
|
private |
Definition at line 636 of file SpellHistory.cpp.
void SpellHistory::ResetCooldown | ( | uint32 | spellId, |
bool | update = false |
||
) |
Definition at line 627 of file SpellHistory.cpp.
|
inline |
Definition at line 130 of file SpellHistory.h.
void SpellHistory::RestoreCharge | ( | uint32 | chargeCategoryId | ) |
Definition at line 848 of file SpellHistory.cpp.
void SpellHistory::RestoreCooldownStateAfterDuel | ( | ) |
Definition at line 1026 of file SpellHistory.cpp.
void SpellHistory::SaveCooldownStateBeforeDuel | ( | ) |
template void SpellHistory::SaveToDB< Pet > | ( | CharacterDatabaseTransaction | trans | ) |
Definition at line 181 of file SpellHistory.cpp.
|
private |
Definition at line 955 of file SpellHistory.cpp.
void SpellHistory::SendCooldownEvent | ( | SpellInfo const * | spellInfo, |
uint32 | itemId = 0 , |
||
Spell * | spell = nullptr , |
||
bool | startCooldown = true |
||
) |
Definition at line 528 of file SpellHistory.cpp.
|
private |
Definition at line 966 of file SpellHistory.cpp.
void SpellHistory::StartCooldown | ( | SpellInfo const * | spellInfo, |
uint32 | itemId, | ||
Spell * | spell = nullptr , |
||
bool | onHold = false , |
||
Optional< Duration > | forcedCooldown = {} |
||
) |
Definition at line 405 of file SpellHistory.cpp.
void SpellHistory::Update | ( | ) |
Definition at line 219 of file SpellHistory.cpp.
void SpellHistory::WritePacket | ( | PacketType * | packet | ) | const |
Definition at line 294 of file SpellHistory.cpp.
void SpellHistory::WritePacket | ( | WorldPackets::Pet::PetSpells * | petSpells | ) | const |
Definition at line 358 of file SpellHistory.cpp.
void SpellHistory::WritePacket | ( | WorldPackets::Spells::SendSpellCharges * | sendSpellCharges | ) | const |
Definition at line 335 of file SpellHistory.cpp.
void SpellHistory::WritePacket | ( | WorldPackets::Spells::SendSpellHistory * | sendSpellHistory | ) | const |
Definition at line 300 of file SpellHistory.cpp.
|
private |
Definition at line 199 of file SpellHistory.h.
|
private |
Definition at line 197 of file SpellHistory.h.
|
private |
Definition at line 200 of file SpellHistory.h.
|
private |
Definition at line 194 of file SpellHistory.h.
|
private |
Definition at line 198 of file SpellHistory.h.
|
private |
Definition at line 195 of file SpellHistory.h.
|
private |
Definition at line 196 of file SpellHistory.h.
|
static |
Definition at line 102 of file SpellHistory.h.