39 return target->
ToPet();
43 return player ? player->
GetPet() :
nullptr;
63 {
"pet", petCommandTable },
83 handler->
PSendSysMessage(
"This creature cannot be tamed. Family id: 0 (CREATURE_FAMILY_NONE).");
198 else if (newLevel > owner->
GetLevel())
@ LANG_SELECT_PLAYER_OR_PET
@ LANG_COMMAND_SPELL_BROKEN
std::optional< T > Optional
Optional helper class to wrap optional values within.
Role Based Access Control related classes definition.
WorldSession * GetSession()
void PSendSysMessage(const char *fmt, Args &&... args)
Creature * getSelectedCreature()
void SetSentErrorMessage(bool val)
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
CreatureTemplate const * GetCreatureTemplate() const
static Creature * ToCreature(Object *o)
static Player * ToPlayer(Object *o)
void GivePetLevel(uint8 level)
Player * GetOwner() const
void SavePetToDB(PetSaveMode mode)
bool removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab=true)
bool HasSpell(uint32 spell) const override
bool learnSpell(uint32 spell_id)
void PetSpellInitialize()
static bool IsSpellValid(SpellInfo const *spellInfo, Player *player=nullptr, bool msg=true)
Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book,...
void SetMinion(Minion *minion, bool apply)
Pet * CreateTamedPetFrom(Creature *creatureTarget, uint32 spell_id=0)
void SetLevel(uint8 lvl, bool sendUpdate=true)
ObjectGuid GetPetGUID() const
Player * GetPlayer() const
ChatCommandTable GetCommands() const override
static bool HandlePetLevelCommand(ChatHandler *handler, Optional< int32 > level)
static bool HandlePetUnlearnCommand(ChatHandler *handler, SpellInfo const *spellInfo)
static bool HandlePetLearnCommand(ChatHandler *handler, SpellInfo const *spellInfo)
static bool HandlePetCreateCommand(ChatHandler *handler)
Pet * GetSelectedPlayerPetOrOwn(ChatHandler *handler)
void AddSC_pet_commandscript()
std::vector< ChatCommandBuilder > ChatCommandTable
@ RBAC_PERM_COMMAND_PET_LEARN
@ RBAC_PERM_COMMAND_PET_LEVEL
@ RBAC_PERM_COMMAND_PET_CREATE
@ RBAC_PERM_COMMAND_PET_UNLEARN