mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +00:00
feat(Core/Player): implement Spell Queue (#20797)
This commit is contained in:
@@ -1060,6 +1060,18 @@ struct EntryPointData
|
||||
[[nodiscard]] bool HasTaxiPath() const { return taxiPath[0] && taxiPath[1]; }
|
||||
};
|
||||
|
||||
struct PendingSpellCastRequest
|
||||
{
|
||||
uint32 spellId;
|
||||
uint32 category;
|
||||
WorldPacket requestPacket;
|
||||
bool isItem = false;
|
||||
bool cancelInProgress = false;
|
||||
|
||||
PendingSpellCastRequest(uint32 spellId, uint32 category, WorldPacket&& packet, bool item = false, bool cancel = false)
|
||||
: spellId(spellId), category(category), requestPacket(std::move(packet)), isItem(item) , cancelInProgress(cancel) {}
|
||||
};
|
||||
|
||||
class Player : public Unit, public GridObject<Player>
|
||||
{
|
||||
friend class WorldSession;
|
||||
@@ -2615,7 +2627,21 @@ public:
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
protected:
|
||||
/*********************************************************/
|
||||
/*** SPELL QUEUE SYSTEM ***/
|
||||
/*********************************************************/
|
||||
protected:
|
||||
uint32 GetSpellQueueWindow() const;
|
||||
void ProcessSpellQueue();
|
||||
|
||||
public:
|
||||
std::deque<PendingSpellCastRequest> SpellQueue;
|
||||
const PendingSpellCastRequest* GetCastRequest(uint32 category) const;
|
||||
bool CanExecutePendingSpellCastRequest(SpellInfo const* spellInfo);
|
||||
void ExecuteOrCancelSpellCastRequest(PendingSpellCastRequest* castRequest, bool isCancel = false);
|
||||
bool CanRequestSpellCast(SpellInfo const* spellInfo);
|
||||
|
||||
protected:
|
||||
// Gamemaster whisper whitelist
|
||||
WhisperListContainer WhisperList;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user