![]() |
TrinityCore
|
#include <SpellHistory.h>
Classes | |
struct | ChargeEntry |
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, std::deque < ChargeEntry > > | ChargeStorageType |
typedef std::unordered_map < uint32, Clock::time_point > | GlobalCooldownStorageType |
Public Member Functions | |
SpellHistory (Unit *owner) | |
template<class OwnerType > | |
void | LoadFromDB (PreparedQueryResult cooldownsResult, PreparedQueryResult chargesResult) |
template<class OwnerType > | |
void | SaveToDB (SQLTransaction &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 PacketType > | |
void | WritePacket (PacketType *packet) 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 | ConsumeCharge (SpellCategoryEntry const *chargeCategoryEntry) |
void | RestoreCharge (SpellCategoryEntry const *chargeCategoryEntry) |
void | ResetCharges (SpellCategoryEntry const *chargeCategoryEntry) |
void | ResetAllCharges () |
bool | HasCharge (SpellCategoryEntry const *chargeCategoryEntry) const |
int32 | GetMaxCharges (SpellCategoryEntry const *chargeCategoryEntry) const |
int32 | GetChargeRecoveryTime (SpellCategoryEntry const *chargeCategoryEntry) const |
bool | HasGlobalCooldown (SpellInfo const *spellInfo) const |
void | AddGlobalCooldown (SpellInfo const *spellInfo, uint32 duration) |
void | CancelGlobalCooldown (SpellInfo const *spellInfo) |
uint16 | GetArenaCooldownsSize () |
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 Clock::duration const | InfinityCooldownDelay = std::chrono::duration_cast<SpellHistory::Clock::duration>(std::chrono::seconds(MONTH)) |
Private Member Functions | |
Player * | GetPlayerOwner () const |
void | SendClearCooldowns (std::vector< int32 > const &cooldowns) const |
CooldownStorageType::iterator | EraseCooldown (CooldownStorageType::iterator itr) |
Static Private Member Functions | |
static void | GetCooldownDurations (SpellInfo const *spellInfo, uint32 itemId, int32 *cooldown, uint32 *categoryId, int32 *categoryCooldown) |
typedef std::unordered_map<uint32 , CooldownEntry*> SpellHistory::CategoryCooldownStorageType |
typedef std::unordered_map<uint32 , std::deque<ChargeEntry> > SpellHistory::ChargeStorageType |
typedef std::chrono::system_clock SpellHistory::Clock |
typedef std::unordered_map<uint32 , CooldownEntry> SpellHistory::CooldownStorageType |
typedef std::unordered_map<uint32 , Clock::time_point> SpellHistory::GlobalCooldownStorageType |
|
inlineexplicit |
|
inline |
void SpellHistory::AddCooldown | ( | uint32 | spellId, |
uint32 | itemId, | ||
Clock::time_point | cooldownEnd, | ||
uint32 | categoryId, | ||
Clock::time_point | categoryEnd, | ||
bool | onHold = false |
||
) |
bool SpellHistory::ConsumeCharge | ( | SpellCategoryEntry const * | chargeCategoryEntry | ) |
|
inlineprivate |
uint16 SpellHistory::GetArenaCooldownsSize | ( | ) |
int32 SpellHistory::GetChargeRecoveryTime | ( | SpellCategoryEntry const * | chargeCategoryEntry | ) | const |
|
staticprivate |
int32 SpellHistory::GetMaxCharges | ( | SpellCategoryEntry const * | chargeCategoryEntry | ) | const |
|
private |
void SpellHistory::HandleCooldowns | ( | SpellInfo const * | spellInfo, |
Item const * | item, | ||
Spell * | spell = nullptr |
||
) |
void SpellHistory::HandleCooldowns | ( | SpellInfo const * | spellInfo, |
uint32 | itemID, | ||
Spell * | spell = nullptr |
||
) |
bool SpellHistory::HasCharge | ( | SpellCategoryEntry const * | chargeCategoryEntry | ) | const |
bool SpellHistory::HasCooldown | ( | SpellInfo const * | spellInfo, |
uint32 | itemId = 0 , |
||
bool | ignoreCategoryCooldown = false |
||
) | const |
bool SpellHistory::HasCooldown | ( | uint32 | spellId, |
uint32 | itemId = 0 , |
||
bool | ignoreCategoryCooldown = false |
||
) | const |
bool SpellHistory::IsReady | ( | SpellInfo const * | spellInfo, |
uint32 | itemId = 0 , |
||
bool | ignoreCategoryCooldown = false |
||
) | const |
bool SpellHistory::IsSchoolLocked | ( | SpellSchoolMask | schoolMask | ) | const |
template void SpellHistory::LoadFromDB< Pet > | ( | PreparedQueryResult | cooldownsResult, |
PreparedQueryResult | chargesResult | ||
) |
void SpellHistory::LockSpellSchool | ( | SpellSchoolMask | schoolMask, |
uint32 | lockoutTime | ||
) |
void SpellHistory::ResetAllCharges | ( | ) |
void SpellHistory::ResetAllCooldowns | ( | ) |
void SpellHistory::ResetCharges | ( | SpellCategoryEntry const * | chargeCategoryEntry | ) |
|
inline |
void SpellHistory::RestoreCharge | ( | SpellCategoryEntry const * | chargeCategoryEntry | ) |
void SpellHistory::RestoreCooldownStateAfterDuel | ( | ) |
void SpellHistory::SaveCooldownStateBeforeDuel | ( | ) |
template void SpellHistory::SaveToDB< Pet > | ( | SQLTransaction & | trans | ) |
void SpellHistory::SendCooldownEvent | ( | SpellInfo const * | spellInfo, |
uint32 | itemId = 0 , |
||
Spell * | spell = nullptr , |
||
bool | startCooldown = true |
||
) |
void SpellHistory::StartCooldown | ( | SpellInfo const * | spellInfo, |
uint32 | itemId, | ||
Spell * | spell = nullptr , |
||
bool | onHold = false |
||
) |
void SpellHistory::Update | ( | ) |
void SpellHistory::WritePacket | ( | PacketType * | packet | ) | const |
void SpellHistory::WritePacket | ( | WorldPackets::Spells::SendSpellHistory * | sendSpellHistory | ) | const |
void SpellHistory::WritePacket | ( | WorldPackets::Spells::SendSpellCharges * | sendSpellCharges | ) | const |
void SpellHistory::WritePacket | ( | WorldPackets::Pet::PetSpells * | petSpells | ) | const |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |