TrinityCore
Loading...
Searching...
No Matches
ObjectDefines.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 TRINITY_OBJECTDEFINES_H
19#define TRINITY_OBJECTDEFINES_H
20
21#include "Define.h"
22
23#define CONTACT_DISTANCE 0.5f
24#define INTERACTION_DISTANCE 5.0f
25#define ATTACK_DISTANCE 5.0f
26#define INSPECT_DISTANCE 28.0f
27#define TRADE_DISTANCE 11.11f
28#define MAX_VISIBILITY_DISTANCE SIZE_OF_GRIDS // max distance for visible objects
29#define SIGHT_RANGE_UNIT 50.0f
30#define VISIBILITY_DISTANCE_GIGANTIC 400.0f
31#define VISIBILITY_DISTANCE_LARGE 200.0f
32#define VISIBILITY_DISTANCE_NORMAL 100.0f
33#define VISIBILITY_DISTANCE_SMALL 50.0f
34#define VISIBILITY_DISTANCE_TINY 25.0f
35#define DEFAULT_VISIBILITY_DISTANCE VISIBILITY_DISTANCE_NORMAL // default visible distance, 100 yards on continents
36#define DEFAULT_VISIBILITY_INSTANCE 170.0f // default visible distance in instances, 170 yards
37#define DEFAULT_VISIBILITY_BGARENAS 533.0f // default visible distance in BG/Arenas, roughly 533 yards
38
39#define DEFAULT_PLAYER_BOUNDING_RADIUS 0.388999998569489f // player size, also currently used (correctly?) for any non Unit world objects
40#define DEFAULT_PLAYER_COMBAT_REACH 1.5f
41#define MIN_MELEE_REACH 2.0f
42#define NOMINAL_MELEE_RANGE 5.0f
43#define MELEE_RANGE (NOMINAL_MELEE_RANGE - MIN_MELEE_REACH * 2) //center to center for players
44
45#define EXTRA_CELL_SEARCH_RADIUS 40.0f // We need in some cases increase search radius. Allow to find creatures with huge combat reach in a different nearby cell.
46
48{
49 Normal = 0,
50 Tiny = 1,
51 Small = 2,
52 Large = 3,
53 Gigantic = 4,
54 Infinite = 5,
55
56 Max
57};
58
60{
61 TEMPSUMMON_TIMED_OR_DEAD_DESPAWN = 1, // despawns after a specified time OR when the creature disappears
62 TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN = 2, // despawns after a specified time OR when the creature dies
63 TEMPSUMMON_TIMED_DESPAWN = 3, // despawns after a specified time
64 TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT = 4, // despawns after a specified time after the creature is out of combat
65 TEMPSUMMON_CORPSE_DESPAWN = 5, // despawns instantly after death
66 TEMPSUMMON_CORPSE_TIMED_DESPAWN = 6, // despawns after a specified time after death
67 TEMPSUMMON_DEAD_DESPAWN = 7, // despawns when the creature disappears
68 TEMPSUMMON_MANUAL_DESPAWN = 8 // despawns when UnSummon() is called
69};
70
72{
73 PHASEMASK_NORMAL = 0x00000001,
74 PHASEMASK_ANYWHERE = 0xFFFFFFFF
75};
76
84
86{
87 GO_SUMMON_TIMED_OR_CORPSE_DESPAWN = 0, // despawns after a specified time OR when the summoner dies
88 GO_SUMMON_TIMED_DESPAWN = 1 // despawns after a specified time
89};
90
92{
93 return uint64(l | (uint64(h) << 32));
94}
95
97{
98 return (uint32)((x >> 32) & UI64LIT(0x00000000FFFFFFFF));
99}
100
102{
103 return (uint32)(x & UI64LIT(0x00000000FFFFFFFF));
104}
105
107{
108 return uint16(l | (uint16(h) << 8));
109}
110
112{
113 return uint32(l | (uint32(h) << 16));
114}
115
117{
118 return (uint16)((x >> 16) & 0x0000FFFF);
119}
120
122{
123 return (uint16)(x & 0x0000FFFF);
124}
125
126#endif
uint8_t uint8
Definition Define.h:135
uint64_t uint64
Definition Define.h:132
#define UI64LIT(N)
Definition Define.h:118
uint16_t uint16
Definition Define.h:134
uint32_t uint32
Definition Define.h:133
uint32 PAIR64_LOPART(uint64 x)
PhaseMasks
@ PHASEMASK_ANYWHERE
@ PHASEMASK_NORMAL
uint32 MAKE_PAIR32(uint16 l, uint16 h)
uint16 PAIR32_HIPART(uint32 x)
TempSummonType
@ TEMPSUMMON_DEAD_DESPAWN
@ TEMPSUMMON_MANUAL_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
@ TEMPSUMMON_CORPSE_DESPAWN
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
GOSummonType
@ GO_SUMMON_TIMED_DESPAWN
@ GO_SUMMON_TIMED_OR_CORPSE_DESPAWN
uint64 MAKE_PAIR64(uint32 l, uint32 h)
uint16 MAKE_PAIR16(uint8 l, uint8 h)
uint32 PAIR64_HIPART(uint64 x)
VisibilityDistanceType
NotifyFlags
@ NOTIFY_ALL
@ NOTIFY_NONE
@ NOTIFY_AI_RELOCATION
@ NOTIFY_VISIBILITY_CHANGED
uint16 PAIR32_LOPART(uint32 x)