18#ifndef TRINITYCORE_PET_H
19#define TRINITYCORE_PET_H
24#define HAPPINESS_LEVEL_SIZE 333000
62 bool IsPermanentPetFor(
Player* owner)
const;
65 bool CreateBaseAtCreature(
Creature* creature);
70 bool IsLoading()
const override {
return m_loading;}
73 void Remove(
PetSaveMode mode,
bool returnreagent =
false);
82 if (pos >= m_autospells.size())
85 return m_autospells[pos];
89 void GivePetLevel(
uint8 level);
92 void SynchronizeLevelWithOwner();
108 void ToggleAutocast(
SpellInfo const* spellInfo,
bool apply);
112 void LearnPetPassives();
113 void CastPetAuras(
bool current);
114 void CastPetAura(
PetAura const* aura);
115 bool IsPetAura(
Aura const* aura);
123 bool learnSpell(
uint32 spell_id);
124 void learnSpells(std::vector<uint32>
const& spellIds);
125 void learnSpellHighRank(
uint32 spellid);
126 void InitLevelupSpellsForLevel();
127 bool unlearnSpell(
uint32 spell_id,
bool learn_prev,
bool clear_ab =
true);
128 void unlearnSpells(std::vector<uint32>
const& spellIds,
bool learn_prev,
bool clear_ab =
true);
129 bool removeSpell(
uint32 spell_id,
bool learn_prev,
bool clear_ab =
true);
130 void CleanupActionBar();
131 std::string GenerateActionBarData()
const;
136 void InitPetCreateSpells();
139 void SetSpecialization(
uint16 spec);
140 void LearnSpecializationSpells();
141 void RemoveSpecializationSpells(
bool clearActionBar);
144 void SetGroupUpdateFlag(
uint32 flag);
145 void ResetGroupUpdateFlag();
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
Definition: DatabaseEnvFwd.h:72
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: DatabaseEnvFwd.h:48
#define TC_GAME_API
Definition: Define.h:124
uint8_t uint8
Definition: Define.h:145
int32_t int32
Definition: Define.h:139
uint16_t uint16
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:143
#define ABORT
Definition: Errors.h:74
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
PetSpellState
Definition: PetDefines.h:62
@ PETSPELL_NEW
Definition: PetDefines.h:65
PetType
Definition: PetDefines.h:30
@ SUMMON_PET
Definition: PetDefines.h:31
@ HUNTER_PET
Definition: PetDefines.h:32
@ MAX_PET_TYPE
Definition: PetDefines.h:33
PetSpellType
Definition: PetDefines.h:70
@ PETSPELL_NORMAL
Definition: PetDefines.h:71
PetSaveMode
Definition: PetDefines.h:41
PetStableinfo
Definition: Pet.h:34
@ PET_STABLE_INACTIVE
Definition: Pet.h:36
@ PET_STABLE_ACTIVE
Definition: Pet.h:35
std::unordered_map< uint32, PetSpell > PetSpellMap
Definition: Pet.h:39
std::vector< uint32 > AutoSpellList
Definition: Pet.h:40
ActiveStates
Definition: UnitDefines.h:477
@ ACT_DECIDE
Definition: UnitDefines.h:483
DeathState
Definition: Unit.h:234
uint32 const Entry[5]
Definition: boss_nefarian.cpp:163
Definition: SpellAuras.h:123
Definition: Creature.h:70
bool HasSpell(uint32 spellID) const override
Definition: Creature.cpp:2737
void SetDisplayId(uint32 displayId, float displayScale=1.f) override
Definition: Creature.cpp:3259
bool Create(ObjectGuid::LowType guidlow, Map *map, uint32 entry, Position const &pos, CreatureData const *data, uint32 vehId, bool dynamic=false)
Definition: Creature.cpp:1061
void AddToWorld() override
Definition: Creature.cpp:324
static bool DeleteFromDB(ObjectGuid::LowType spawnId)
Definition: Creature.cpp:1925
float GetNativeObjectScale() const override
Definition: Creature.cpp:3243
Definition: TemporarySummon.h:117
std::string GetDebugInfo() const override
Definition: TemporarySummon.cpp:483
void setDeathState(DeathState s) override
Definition: TemporarySummon.cpp:411
void RemoveFromWorld() override
Definition: TemporarySummon.cpp:402
Unit * GetOwner() const
Definition: TemporarySummon.h:89
uint64 LowType
Definition: ObjectGuid.h:268
void SetUpdateFieldValue(UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type value)
Definition: Object.h:271
Definition: SpellMgr.h:477
Definition: PetDefines.h:116
uint16 GetSpecialization() const
Definition: Pet.h:138
PetType m_petType
Definition: Pet.h:156
void SetDuration(int32 dur)
Definition: Pet.h:94
bool m_loading
Definition: Pet.h:158
uint16 m_petSpecialization
Definition: Pet.h:164
uint32 m_focusRegenTimer
Definition: Pet.h:159
void setPetType(PetType type)
Definition: Pet.h:58
PetType getPetType() const
Definition: Pet.h:57
std::unique_ptr< DeclinedName > m_declinedname
Definition: Pet.h:162
uint32 GetPetAutoSpellOnPos(uint8 pos) const override
Definition: Pet.h:80
AutoSpellList m_autospells
Definition: Pet.h:134
void SetPetExperience(uint32 xp)
Definition: Pet.h:90
DeclinedName const * GetDeclinedNames() const
Definition: Pet.h:147
bool isTemporarySummoned() const
Definition: Pet.h:60
int32 GetDuration() const
Definition: Pet.h:95
bool isControlled() const
Definition: Pet.h:59
bool IsLoading() const override
Definition: Pet.h:70
void SetPetNextLevelExperience(uint32 xp)
Definition: Pet.h:91
bool m_removed
Definition: Pet.h:149
uint32 GetGroupUpdateFlag() const
Definition: Pet.h:143
void SaveToDB(uint32, std::vector< Difficulty > const &) override
Definition: Pet.h:167
uint8 GetPetAutoSpellSize() const override
Definition: Pet.h:79
uint32 m_groupUpdateMask
Definition: Pet.h:160
PetSpellMap m_spells
Definition: Pet.h:133
int32 m_duration
Definition: Pet.h:157
Definition: Player.h:1125
Definition: SpellInfo.h:322
void Update(uint32 time) override
Definition: TemporarySummon.cpp:69
UF::UpdateField< UF::UnitData, 0, TYPEID_UNIT > m_unitData
Definition: Unit.h:1900
Definition: CreatureData.h:471
Definition: UnitDefines.h:472
Definition: ItemTemplate.h:754
PetSpellState state
Definition: Pet.h:29
PetSpellType type
Definition: Pet.h:30
ActiveStates active
Definition: Pet.h:28
Definition: PetDefines.h:119
UpdateField< uint32, 64, 69 > PetExperience
Definition: UpdateFields.h:332
UpdateField< uint32, 64, 70 > PetNextLevelExperience
Definition: UpdateFields.h:333