18#ifndef TRINITYCORE_PET_H
19#define TRINITYCORE_PET_H
24#define HAPPINESS_LEVEL_SIZE 333000
56 bool IsPermanentPetFor(
Player* owner)
const;
59 bool CreateBaseAtCreature(
Creature* creature);
62 static std::pair<PetStable::PetInfo const*, PetSaveMode> GetLoadPetInfo(
PetStable const& stable,
uint32 petEntry,
uint32 petnumber,
bool current);
64 bool IsLoading()
const override {
return m_loading;}
67 void Remove(
PetSaveMode mode,
bool returnreagent =
false);
76 if (pos >= m_autospells.size())
79 return m_autospells[pos];
85 void GivePetLevel(
uint8 level);
88 void SynchronizeLevelWithOwner();
90 uint32 GetCurrentFoodBenefitLevel(
uint32 itemlevel)
const;
105 void ToggleAutocast(
SpellInfo const* spellInfo,
bool apply);
109 void LearnPetPassives();
110 void CastPetAuras(
bool current);
111 void CastPetAura(
PetAura const* aura);
112 bool IsPetAura(
Aura const* aura);
120 bool learnSpell(
uint32 spell_id);
121 void learnSpellHighRank(
uint32 spellid);
122 void InitLevelupSpellsForLevel();
123 bool unlearnSpell(
uint32 spell_id,
bool learn_prev,
bool clear_ab =
true);
124 bool removeSpell(
uint32 spell_id,
bool learn_prev,
bool clear_ab =
true);
125 void CleanupActionBar();
126 std::string GenerateActionBarData()
const;
131 void InitPetCreateSpells();
133 bool resetTalents(
bool involuntarily =
false);
134 static void resetTalentsForAllPetsOf(
Player* owner,
Pet* online_pet =
nullptr,
bool involuntarily =
false);
135 void InitTalentForLevel();
137 uint8 GetMaxTalentPointsForLevel(
uint8 level)
const;
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
std::shared_ptr< PreparedResultSet > PreparedQueryResult
std::unordered_map< uint32, PetSpell > PetSpellMap
std::vector< uint32 > AutoSpellList
@ UNIT_BYTES_1_OFFSET_PET_TALENTS
@ UNIT_FIELD_PETEXPERIENCE
@ UNIT_FIELD_PETNEXTLEVELEXP
bool HasSpell(uint32 spellID) const override
void SetDisplayId(uint32 modelId) override
void AddToWorld() override
static bool DeleteFromDB(ObjectGuid::LowType spawnId)
float GetNativeObjectScale() const override
bool Create(ObjectGuid::LowType guidlow, Map *map, uint32 phaseMask, uint32 entry, Position const &pos, CreatureData const *data=nullptr, uint32 vehId=0, bool dynamic=false)
std::string GetDebugInfo() const override
void setDeathState(DeathState s) override
void RemoveFromWorld() override
uint8 GetByteValue(uint16 index, uint8 offset) const
void SetByteValue(uint16 index, uint8 offset, uint8 value)
void SetUInt32Value(uint16 index, uint32 value)
void ResetAuraUpdateMaskForRaid()
uint8 GetFreeTalentPoints() const
void SetDuration(int32 dur)
void setPetType(PetType type)
PetType getPetType() const
std::unique_ptr< DeclinedName > m_declinedname
uint32 GetPetAutoSpellOnPos(uint8 pos) const override
AutoSpellList m_autospells
void SetPetExperience(uint32 xp)
uint64 GetAuraUpdateMaskForRaid() const
DeclinedName const * GetDeclinedNames() const
void SaveToDB(uint32, uint8, uint32) override
bool isTemporarySummoned() const
int32 GetDuration() const
bool isControlled() const
bool IsLoading() const override
void SetPetNextLevelExperience(uint32 xp)
void SetFreeTalentPoints(uint8 points)
uint64 m_auraRaidUpdateMask
uint8 GetPetAutoSpellSize() const override
void SetAuraUpdateMaskForRaid(uint8 slot)
void Update(uint32 time) override