TrinityCore
Loading...
Searching...
No Matches
PetDefines.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITYCORE_PET_DEFINES_H
19#define TRINITYCORE_PET_DEFINES_H
20
21#include "Define.h"
22#include "Optional.h"
23#include <array>
24#include <string>
25#include <vector>
26
27enum ReactStates : uint8;
28
35
36#define MAX_PET_STABLES 4
37
38// stored in character_pet.slot
40{
41 PET_SAVE_AS_DELETED = -1, // not saved in fact
42 PET_SAVE_AS_CURRENT = 0, // in current slot (with player)
44 PET_SAVE_LAST_STABLE_SLOT = MAX_PET_STABLES, // last in DB stable slot index (including), all higher have same meaning as PET_SAVE_NOT_IN_SLOT
45 PET_SAVE_NOT_IN_SLOT = 100 // for avoid conflict with stable size grow will use 100
46};
47
49{
52 HAPPY = 3
53};
54
62
69
71{
72 None = 0,
73 Dead = 1,
74 NoTarget = 2,
75 InvalidTarget = 3,
76 NoPath = 4
77};
78
84
85#define PET_FOLLOW_DIST 1.0f
86#define PET_FOLLOW_ANGLE float(M_PI/2)
87
89{
90public:
111
112 Optional<PetInfo> CurrentPet; // PET_SAVE_AS_CURRENT
113 std::array<Optional<PetInfo>, MAX_PET_STABLES> StabledPets; // PET_SAVE_FIRST_STABLE_SLOT - PET_SAVE_LAST_STABLE_SLOT
115 std::vector<PetInfo> UnslottedPets; // PET_SAVE_NOT_IN_SLOT
116
118 {
119 return UnslottedPets.size() == 1 && UnslottedPets[0].Type == HUNTER_PET ? &UnslottedPets[0] : nullptr;
120 }
121};
122
123#endif
uint8_t uint8
Definition Define.h:135
int8_t int8
Definition Define.h:131
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
PetSpellState
Definition PetDefines.h:56
@ PETSPELL_NEW
Definition PetDefines.h:59
@ PETSPELL_UNCHANGED
Definition PetDefines.h:57
@ PETSPELL_CHANGED
Definition PetDefines.h:58
@ PETSPELL_REMOVED
Definition PetDefines.h:60
#define MAX_PET_STABLES
Definition PetDefines.h:36
PetSaveMode
Definition PetDefines.h:40
@ PET_SAVE_FIRST_STABLE_SLOT
Definition PetDefines.h:43
@ PET_SAVE_LAST_STABLE_SLOT
Definition PetDefines.h:44
@ PET_SAVE_AS_DELETED
Definition PetDefines.h:41
@ PET_SAVE_NOT_IN_SLOT
Definition PetDefines.h:45
@ PET_SAVE_AS_CURRENT
Definition PetDefines.h:42
PetActionFeedback
Definition PetDefines.h:71
PetAction
Definition PetDefines.h:80
@ PET_ACTION_ATTACK
Definition PetDefines.h:82
@ PET_ACTION_SPECIAL_SPELL
Definition PetDefines.h:81
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:64
@ PETSPELL_TALENT
Definition PetDefines.h:67
@ PETSPELL_NORMAL
Definition PetDefines.h:65
@ PETSPELL_FAMILY
Definition PetDefines.h:66
HappinessState
Definition PetDefines.h:49
@ HAPPY
Definition PetDefines.h:52
@ CONTENT
Definition PetDefines.h:51
@ UNHAPPY
Definition PetDefines.h:50
ReactStates
uint32 MaxStabledPets
Definition PetDefines.h:114
PetInfo const * GetUnslottedHunterPet() const
Definition PetDefines.h:117
std::array< Optional< PetInfo >, MAX_PET_STABLES > StabledPets
Definition PetDefines.h:113
Optional< PetInfo > CurrentPet
Definition PetDefines.h:112
std::vector< PetInfo > UnslottedPets
Definition PetDefines.h:115
ReactStates ReactState
Definition PetDefines.h:107
std::string Name
Definition PetDefines.h:95
std::string ActionBar
Definition PetDefines.h:96