TrinityCore
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 DEFAULT_PLAYER_DISPLAY_SCALE 1.0f
42#define DEFAULT_PLAYER_HOVER_HEIGHT 1.0f
43#define MIN_MELEE_REACH 2.0f
44#define NOMINAL_MELEE_RANGE 5.0f
45#define MELEE_RANGE (NOMINAL_MELEE_RANGE - MIN_MELEE_REACH * 2) //center to center for players
46
47#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.
48
50{
51 Normal = 0,
52 Tiny = 1,
53 Small = 2,
54 Large = 3,
55 Gigantic = 4,
56 Infinite = 5,
57
58 Max
59};
60
62{
63 TEMPSUMMON_TIMED_OR_DEAD_DESPAWN = 1, // despawns after a specified time OR when the creature disappears
64 TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN = 2, // despawns after a specified time OR when the creature dies
65 TEMPSUMMON_TIMED_DESPAWN = 3, // despawns after a specified time
66 TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT = 4, // despawns after a specified time after the creature is out of combat
67 TEMPSUMMON_CORPSE_DESPAWN = 5, // despawns instantly after death
68 TEMPSUMMON_CORPSE_TIMED_DESPAWN = 6, // despawns after a specified time after death
69 TEMPSUMMON_DEAD_DESPAWN = 7, // despawns when the creature disappears
70 TEMPSUMMON_MANUAL_DESPAWN = 8 // despawns when UnSummon() is called
71};
72
74{
78 NOTIFY_ALL = 0xFF
79};
80
82{
83 GO_SUMMON_TIMED_OR_CORPSE_DESPAWN = 0, // despawns after a specified time OR when the summoner dies
84 GO_SUMMON_TIMED_DESPAWN = 1 // despawns after a specified time
85};
86
88{
89 return uint64(l | (uint64(h) << 32));
90}
91
93{
94 return (uint32)((x >> 32) & UI64LIT(0x00000000FFFFFFFF));
95}
96
98{
99 return (uint32)(x & UI64LIT(0x00000000FFFFFFFF));
100}
101
103{
104 return uint16(l | (uint16(h) << 8));
105}
106
108{
109 return uint32(l | (uint32(h) << 16));
110}
111
113{
114 return (uint16)((x >> 16) & 0x0000FFFF);
115}
116
118{
119 return (uint16)(x & 0x0000FFFF);
120}
121
122#endif
uint8_t uint8
Definition: Define.h:144
uint64_t uint64
Definition: Define.h:141
#define UI64LIT(N)
Definition: Define.h:127
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
uint32 PAIR64_LOPART(uint64 x)
Definition: ObjectDefines.h:97
uint32 MAKE_PAIR32(uint16 l, uint16 h)
uint16 PAIR32_HIPART(uint32 x)
TempSummonType
Definition: ObjectDefines.h:62
@ TEMPSUMMON_DEAD_DESPAWN
Definition: ObjectDefines.h:69
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: ObjectDefines.h:70
@ TEMPSUMMON_TIMED_DESPAWN
Definition: ObjectDefines.h:65
@ TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT
Definition: ObjectDefines.h:66
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Definition: ObjectDefines.h:63
@ TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN
Definition: ObjectDefines.h:64
@ TEMPSUMMON_CORPSE_DESPAWN
Definition: ObjectDefines.h:67
@ TEMPSUMMON_CORPSE_TIMED_DESPAWN
Definition: ObjectDefines.h:68
GOSummonType
Definition: ObjectDefines.h:82
@ GO_SUMMON_TIMED_DESPAWN
Definition: ObjectDefines.h:84
@ GO_SUMMON_TIMED_OR_CORPSE_DESPAWN
Definition: ObjectDefines.h:83
uint64 MAKE_PAIR64(uint32 l, uint32 h)
Definition: ObjectDefines.h:87
uint16 MAKE_PAIR16(uint8 l, uint8 h)
uint32 PAIR64_HIPART(uint64 x)
Definition: ObjectDefines.h:92
VisibilityDistanceType
Definition: ObjectDefines.h:50
NotifyFlags
Definition: ObjectDefines.h:74
@ NOTIFY_ALL
Definition: ObjectDefines.h:78
@ NOTIFY_NONE
Definition: ObjectDefines.h:75
@ NOTIFY_AI_RELOCATION
Definition: ObjectDefines.h:76
@ NOTIFY_VISIBILITY_CHANGED
Definition: ObjectDefines.h:77
uint16 PAIR32_LOPART(uint32 x)