19 #ifndef TRINITYCORE_PET_H
20 #define TRINITYCORE_PET_H
25 #define PET_FOCUS_REGEN_INTERVAL 4 * IN_MILLISECONDS
26 #define HAPPINESS_LEVEL_SIZE 333000
62 bool IsPermanentPetFor(
Player* owner)
const;
65 bool CreateBaseAtCreature(
Creature* creature);
68 bool LoadPetFromDB(
Player* owner,
uint32 petentry = 0,
uint32 petnumber = 0,
bool current =
false);
69 bool IsLoading()
const override {
return m_loading;}
80 if (pos >= m_autospells.size())
83 return m_autospells[pos];
87 void GivePetLevel(
uint8 level);
88 void SynchronizeLevelWithOwner();
90 uint32 GetCurrentFoodBenefitLevel(
uint32 itemlevel)
const;
109 void LearnPetPassives();
110 void CastPetAuras(
bool current);
111 void CastPetAura(
PetAura const* aura);
112 bool IsPetAura(
Aura const* aura);
114 void _LoadSpellCooldowns();
115 void _LoadAuras(
uint32 timediff);
121 bool learnSpell(
uint32 spell_id);
122 void learnSpellHighRank(
uint32 spellid);
123 void InitLevelupSpellsForLevel();
124 bool unlearnSpell(
uint32 spell_id,
bool learn_prev,
bool clear_ab =
true);
125 bool removeSpell(
uint32 spell_id,
bool learn_prev,
bool clear_ab =
true);
126 void CleanupActionBar();
131 void InitPetCreateSpells();
134 static void resetTalentsForAllPetsOf(
Player* owner,
Pet* online_pet =
nullptr);
135 void InitTalentForLevel();
137 uint8 GetMaxTalentPointsForLevel(
uint8 level)
const;
144 void SetGroupUpdateFlag(
uint32 flag);
145 void ResetGroupUpdateFlag();
bool Remove(ContainerUnorderedMap< SPECIFIC_TYPE, KEY_TYPE > &elements, KEY_TYPE const &handle, SPECIFIC_TYPE *)
Definition: TypeContainerFunctions.h:104
PetSpellType type
Definition: Pet.h:32
Definition: TemporarySummon.h:83
Definition: PetDefines.h:24
void DeleteFromDB() override
Definition: Pet.h:167
void AddToWorld() override
Definition: Creature.cpp:218
Definition: SpellInfo.h:326
uint32 m_usedTalentCount
Definition: Pet.h:141
Definition: PetDefines.h:52
AutoSpellList m_autospells
Definition: Pet.h:129
void SaveToDB(uint32, uint32, uint32) override
Definition: Pet.h:163
void setPetType(PetType type)
Definition: Pet.h:58
bool Create(ObjectGuid::LowType guidlow, Map *map, uint32 phaseMask, uint32 entry, float x, float y, float z, float ang, CreatureData const *data=nullptr, uint32 vehId=0)
Definition: Creature.cpp:834
bool HasSpell(uint32 spellID) const override
Definition: Creature.cpp:2337
int32 m_duration
Definition: Pet.h:155
Definition: Creature.h:467
uint32 m_groupUpdateMask
Definition: Pet.h:158
bool m_loading
Definition: Pet.h:156
uint64 LowType
Definition: ObjectGuid.h:199
void apply(T *val)
Definition: ByteConverter.h:41
PetStableinfo
Definition: Pet.h:35
std::vector< uint32 > AutoSpellList
Definition: Pet.h:42
int32 GetDuration() const
Definition: Pet.h:92
bool IsLoading() const override
Definition: Pet.h:69
virtual void DeleteFromDB()
Definition: Creature.cpp:1474
Definition: PetDefines.h:25
std::unordered_map< uint32, PetSpell > PetSpellMap
Definition: Pet.h:41
uint8 GetPetAutoSpellSize() const override
Definition: Pet.h:77
Definition: PetDefines.h:58
Unit * GetOwner() const
Definition: TemporarySummon.h:72
PetSaveMode
Definition: PetDefines.h:32
Entry
Definition: boss_headless_horseman.cpp:50
void setDeathState(DeathState s) override
Definition: Creature.cpp:1624
Definition: SpellMgr.h:433
bool isTemporarySummoned() const
Definition: Pet.h:60
void SetByteValue(uint16 index, uint8 offset, uint8 value)
Definition: Object.cpp:1080
uint8 GetFreeTalentPoints() const
Definition: Pet.h:138
bool isControlled() const
Definition: Pet.h:59
DeclinedName const * GetDeclinedNames() const
Definition: Pet.h:147
int32_t int32
Definition: Define.h:146
uint32 GetGroupUpdateFlag() const
Definition: Pet.h:143
uint32_t uint32
Definition: Define.h:150
Definition: PetDefines.h:26
void SetFreeTalentPoints(uint8 points)
Definition: Pet.h:139
void SetDuration(int32 dur)
Definition: Pet.h:91
void RemoveFromWorld() override
Definition: TemporarySummon.cpp:310
PetSpellMap m_spells
Definition: Pet.h:128
DeathState
Definition: Unit.h:539
bool m_removed
Definition: Pet.h:149
ActiveStates
Definition: Unit.h:1117
uint8_t uint8
Definition: g3dmath.h:164
void SetDisplayId(uint32 modelId) override
Definition: Creature.cpp:2664
Definition: ItemTemplate.h:647
PetType m_petType
Definition: Pet.h:154
uint32 m_focusRegenTimer
Definition: Pet.h:157
PetSpellType
Definition: PetDefines.h:56
#define TC_GAME_API
Definition: Define.h:134
#define ABORT
Definition: Errors.h:56
Definition: UpdateFields.h:124
uint8_t uint8
Definition: Define.h:152
uint32 GetPetAutoSpellOnPos(uint8 pos) const override
Definition: Pet.h:78
void Update(uint32 time) override
Definition: TemporarySummon.cpp:47
Definition: SpellAuras.h:116
ActiveStates active
Definition: Pet.h:30
PetSpellState
Definition: PetDefines.h:48
PetType
Definition: PetDefines.h:22
Definition: Creature.h:79
uint8 GetByteValue(uint16 index, uint8 offset) const
Definition: Object.cpp:318
PetType getPetType() const
Definition: Pet.h:57
PetSpellState state
Definition: Pet.h:31
DeclinedName * m_declinedname
Definition: Pet.h:160
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58