TrinityCore
AreaTriggerDataStore.cpp
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
19#include "AreaTrigger.h"
20#include "AreaTriggerTemplate.h"
21#include "Containers.h"
22#include "DatabaseEnv.h"
23#include "DB2Stores.h"
24#include "Log.h"
25#include "MapManager.h"
26#include "ObjectMgr.h"
27#include "SpellMgr.h"
28#include "Timer.h"
29#include <cmath>
30
31template <>
32struct std::hash<AreaTriggerId>
33{
34 std::size_t operator()(AreaTriggerId const& value) const noexcept
35 {
36 size_t hashVal = 0;
37 Trinity::hash_combine(hashVal, value.Id);
38 Trinity::hash_combine(hashVal, value.IsCustom);
39 return hashVal;
40 }
41};
42
43namespace
44{
45 typedef std::unordered_map<uint32/*cell_id*/, std::set<ObjectGuid::LowType>> AtCellObjectGuidsMap;
46 typedef std::unordered_map<std::pair<uint32 /*mapId*/, Difficulty>, AtCellObjectGuidsMap> AtMapObjectGuids;
47
48 AtMapObjectGuids _areaTriggerSpawnsByLocation;
49 std::unordered_map<ObjectGuid::LowType, AreaTriggerSpawn> _areaTriggerSpawnsBySpawnId;
50 std::unordered_map<AreaTriggerId, AreaTriggerTemplate> _areaTriggerTemplateStore;
51 std::unordered_map<AreaTriggerCreatePropertiesId, AreaTriggerCreateProperties> _areaTriggerCreateProperties;
52}
53
55{
56 uint32 oldMSTime = getMSTime();
57 std::unordered_map<AreaTriggerCreatePropertiesId, std::vector<TaggedPosition<Position::XY>>> verticesByCreateProperties;
58 std::unordered_map<AreaTriggerCreatePropertiesId, std::vector<TaggedPosition<Position::XY>>> verticesTargetByCreateProperties;
59 std::unordered_map<AreaTriggerCreatePropertiesId, std::vector<Position>> splinesByCreateProperties;
60 std::unordered_map<AreaTriggerId, std::vector<AreaTriggerAction>> actionsByAreaTrigger;
61
62 // 0 1 2 3 4
63 if (QueryResult templateActions = WorldDatabase.Query("SELECT AreaTriggerId, IsCustom, ActionType, ActionParam, TargetType FROM `areatrigger_template_actions`"))
64 {
65 do
66 {
67 Field* templateActionFields = templateActions->Fetch();
68 AreaTriggerId areaTriggerId = { templateActionFields[0].GetUInt32(), templateActionFields[1].GetBool()};
69
70 AreaTriggerAction action;
71 action.Param = templateActionFields[3].GetUInt32();
72 uint32 actionType = templateActionFields[2].GetUInt32();
73 uint32 targetType = templateActionFields[4].GetUInt32();
74
75 if (actionType >= AREATRIGGER_ACTION_MAX)
76 {
77 TC_LOG_ERROR("sql.sql", "Table `areatrigger_template_actions` has invalid ActionType {} for AreaTriggerId ({},{}) and Param {}",
78 actionType, areaTriggerId.Id, uint32(areaTriggerId.IsCustom), action.Param);
79 continue;
80 }
81
82 if (targetType >= AREATRIGGER_ACTION_USER_MAX)
83 {
84 TC_LOG_ERROR("sql.sql", "Table `areatrigger_template_actions` has invalid TargetType {} for AreaTriggerId ({},{}) and Param {}",
85 targetType, areaTriggerId.Id, uint32(areaTriggerId.IsCustom), action.Param);
86 continue;
87 }
88
89 if (actionType == AREATRIGGER_ACTION_TELEPORT)
90 {
91 if (!sObjectMgr->GetWorldSafeLoc(action.Param))
92 {
93 TC_LOG_ERROR("sql.sql", "Table `areatrigger_template_actions` has invalid entry for AreaTriggerId ({},{}) with TargetType=Teleport and Param ({}) not a valid world safe loc entry",
94 areaTriggerId.Id, uint32(areaTriggerId.IsCustom), action.Param);
95 continue;
96 }
97 }
98
99 action.TargetType = AreaTriggerActionUserTypes(targetType);
100 action.ActionType = AreaTriggerActionTypes(actionType);
101
102 actionsByAreaTrigger[areaTriggerId].push_back(action);
103 }
104 while (templateActions->NextRow());
105 }
106 else
107 {
108 TC_LOG_INFO("server.loading", ">> Loaded 0 AreaTrigger templates actions. DB table `areatrigger_template_actions` is empty.");
109 }
110
111 // 0 1 2 3 4 5 6
112 if (QueryResult vertices = WorldDatabase.Query("SELECT AreaTriggerCreatePropertiesId, IsCustom, Idx, VerticeX, VerticeY, VerticeTargetX, VerticeTargetY FROM `areatrigger_create_properties_polygon_vertex` ORDER BY `AreaTriggerCreatePropertiesId`, `IsCustom`, `Idx`"))
113 {
114 do
115 {
116 Field* verticeFields = vertices->Fetch();
117 AreaTriggerCreatePropertiesId createPropertiesId = { verticeFields[0].GetUInt32(), verticeFields[1].GetBool() };
118
119 verticesByCreateProperties[createPropertiesId].emplace_back(verticeFields[3].GetFloat(), verticeFields[4].GetFloat());
120
121 if (!verticeFields[5].IsNull() && !verticeFields[6].IsNull())
122 verticesTargetByCreateProperties[createPropertiesId].emplace_back(verticeFields[5].GetFloat(), verticeFields[6].GetFloat());
123 else if (verticeFields[5].IsNull() != verticeFields[6].IsNull())
124 TC_LOG_ERROR("sql.sql", "Table `areatrigger_create_properties_polygon_vertex` has listed invalid target vertices (AreaTriggerCreatePropertiesId: (Id: {}, IsCustom: {}), Index: {}).",
125 createPropertiesId.Id, uint32(createPropertiesId.IsCustom), verticeFields[1].GetUInt32());
126 }
127 while (vertices->NextRow());
128 }
129 else
130 {
131 TC_LOG_INFO("server.loading", ">> Loaded 0 AreaTrigger polygon vertices. DB table `areatrigger_create_properties_polygon_vertex` is empty.");
132 }
133
134 // 0 1 2 3, 4
135 if (QueryResult splines = WorldDatabase.Query("SELECT AreaTriggerCreatePropertiesId, IsCustom, X, Y, Z FROM `areatrigger_create_properties_spline_point` ORDER BY `AreaTriggerCreatePropertiesId`, `IsCustom`, `Idx`"))
136 {
137 do
138 {
139 Field* splineFields = splines->Fetch();
140 AreaTriggerCreatePropertiesId createPropertiesId = { splineFields[0].GetUInt32(), splineFields[1].GetBool() };
141 splinesByCreateProperties[createPropertiesId].emplace_back(splineFields[2].GetFloat(), splineFields[3].GetFloat(), splineFields[4].GetFloat());
142 }
143 while (splines->NextRow());
144 }
145 else
146 {
147 TC_LOG_INFO("server.loading", ">> Loaded 0 AreaTrigger splines. DB table `areatrigger_create_properties_spline_point` is empty.");
148 }
149
150 // 0 1 2
151 if (QueryResult templates = WorldDatabase.Query("SELECT Id, IsCustom, Flags FROM `areatrigger_template`"))
152 {
153 do
154 {
155 Field* fields = templates->Fetch();
156
157 AreaTriggerTemplate areaTriggerTemplate;
158 areaTriggerTemplate.Id.Id = fields[0].GetUInt32();
159 areaTriggerTemplate.Id.IsCustom = fields[1].GetBool();
160 areaTriggerTemplate.Flags = AreaTriggerFlag(fields[2].GetUInt32());
161 areaTriggerTemplate.Actions = std::move(actionsByAreaTrigger[areaTriggerTemplate.Id]);
162
163 _areaTriggerTemplateStore[areaTriggerTemplate.Id] = areaTriggerTemplate;
164 }
165 while (templates->NextRow());
166 }
167
168 // 0 1 2 3 4
169 if (QueryResult areatriggerCreateProperties = WorldDatabase.Query("SELECT Id, IsCustom, AreaTriggerId, IsAreatriggerCustom, Flags, "
170 // 5 6 7 8 9 10 11 12 13
171 "MoveCurveId, ScaleCurveId, MorphCurveId, FacingCurveId, AnimId, AnimKitId, DecalPropertiesId, TimeToTarget, TimeToTargetScale, "
172 // 14 15 16 17 18 19 20 21 22 23
173 "Shape, ShapeData0, ShapeData1, ShapeData2, ShapeData3, ShapeData4, ShapeData5, ShapeData6, ShapeData7, ScriptName FROM `areatrigger_create_properties`"))
174 {
175 do
176 {
177 AreaTriggerCreateProperties createProperties;
178
179 Field* fields = areatriggerCreateProperties->Fetch();
180 AreaTriggerCreatePropertiesId createPropertiesId = { fields[0].GetUInt32(), fields[1].GetBool() };
181 createProperties.Id = createPropertiesId;
182
183 AreaTriggerId areaTriggerId = { fields[2].GetUInt32(), fields[3].GetBool() };
184 createProperties.Template = GetAreaTriggerTemplate(areaTriggerId);
185
186 createProperties.Flags = AreaTriggerCreatePropertiesFlag(fields[4].GetUInt32());
187
188 AreaTriggerShapeType shape = AreaTriggerShapeType(fields[14].GetUInt8());
189
190 if (areaTriggerId.Id && !createProperties.Template)
191 {
192 TC_LOG_ERROR("sql.sql", "Table `areatrigger_create_properties` references invalid AreaTrigger (Id: {}, IsCustom: {}) for AreaTriggerCreatePropertiesId (Id: {}, IsCustom: {})",
193 areaTriggerId.Id, uint32(areaTriggerId.IsCustom), createPropertiesId.Id, uint32(createPropertiesId.IsCustom));
194 continue;
195 }
196
197 if (shape >= AreaTriggerShapeType::Max)
198 {
199 TC_LOG_ERROR("sql.sql", "Table `areatrigger_create_properties` has listed AreaTriggerCreatePropertiesId (Id: {}, IsCustom: {}) with invalid shape {}.",
200 createPropertiesId.Id, uint32(createPropertiesId.IsCustom), uint32(shape));
201 continue;
202 }
203
204#define VALIDATE_AND_SET_CURVE(Curve, Value) \
205 createProperties.Curve = Value; \
206 if (createProperties.Curve && !sCurveStore.LookupEntry(createProperties.Curve)) \
207 { \
208 TC_LOG_ERROR("sql.sql", "Table `areatrigger_create_properties` has listed AreaTrigger (Id: {}, IsCustom: {}) for AreaTriggerCreatePropertiesId (Id: {}, IsCustom: {}) with invalid " #Curve " ({}), set to 0!", \
209 areaTriggerId.Id, uint32(areaTriggerId.IsCustom), createPropertiesId.Id, uint32(createPropertiesId.IsCustom), createProperties.Curve); \
210 createProperties.Curve = 0; \
211 }
212
213 VALIDATE_AND_SET_CURVE(MoveCurveId, fields[5].GetUInt32());
214 VALIDATE_AND_SET_CURVE(ScaleCurveId, fields[6].GetUInt32());
215 VALIDATE_AND_SET_CURVE(MorphCurveId, fields[7].GetUInt32());
216 VALIDATE_AND_SET_CURVE(FacingCurveId, fields[8].GetUInt32());
217
218#undef VALIDATE_AND_SET_CURVE
219
220 createProperties.AnimId = fields[9].GetInt32();
221 createProperties.AnimKitId = fields[10].GetInt32();
222
223 createProperties.DecalPropertiesId = fields[11].GetUInt32();
224
225 createProperties.TimeToTarget = fields[12].GetUInt32();
226 createProperties.TimeToTargetScale = fields[13].GetUInt32();
227
228 createProperties.Shape.Type = static_cast<AreaTriggerShapeType>(shape);
229 for (uint8 i = 0; i < MAX_AREATRIGGER_ENTITY_DATA; ++i)
230 createProperties.Shape.DefaultDatas.Data[i] = fields[15 + i].GetFloat();
231
232 createProperties.ScriptId = sObjectMgr->GetScriptId(fields[23].GetString());
233
235 {
236 if (createProperties.Shape.PolygonDatas.Height <= 0.0f)
237 {
238 createProperties.Shape.PolygonDatas.Height = 1.0f;
239 if (createProperties.Shape.PolygonDatas.HeightTarget <= 0.0f)
240 createProperties.Shape.PolygonDatas.HeightTarget = 1.0f;
241 }
242 }
243
244 createProperties.Shape.PolygonVertices = std::move(verticesByCreateProperties[createProperties.Id]);
245 createProperties.Shape.PolygonVerticesTarget = std::move(verticesTargetByCreateProperties[createProperties.Id]);
246 if (!createProperties.Shape.PolygonVerticesTarget.empty() && createProperties.Shape.PolygonVertices.size() != createProperties.Shape.PolygonVerticesTarget.size())
247 {
248 TC_LOG_ERROR("sql.sql", "Table `areatrigger_create_properties_polygon_vertex` has invalid target vertices, either all or none vertices must have a corresponding target vertex (AreaTriggerCreatePropertiesId: (Id: {}, IsCustom: {})).",
249 createPropertiesId.Id, uint32(createPropertiesId.IsCustom));
250 createProperties.Shape.PolygonVerticesTarget.clear();
251 }
252
253 createProperties.SplinePoints = std::move(splinesByCreateProperties[createProperties.Id]);
254
255 _areaTriggerCreateProperties[createProperties.Id] = createProperties;
256 }
257 while (areatriggerCreateProperties->NextRow());
258 }
259 else
260 {
261 TC_LOG_INFO("server.loading", ">> Loaded 0 AreaTrigger create properties. DB table `areatrigger_create_properties` is empty.");
262 }
263
264 // 0 1 2 3 4 5 6 7 8
265 if (QueryResult circularMovementInfos = WorldDatabase.Query("SELECT AreaTriggerCreatePropertiesId, IsCustom, StartDelay, CircleRadius, BlendFromRadius, InitialAngle, ZOffset, CounterClockwise, CanLoop FROM `areatrigger_create_properties_orbit`"))
266 {
267 do
268 {
269 Field* circularMovementInfoFields = circularMovementInfos->Fetch();
270 AreaTriggerCreatePropertiesId createPropertiesId = { circularMovementInfoFields[0].GetUInt32(), circularMovementInfoFields[1].GetBool() };
271
272 AreaTriggerCreateProperties* createProperties = Trinity::Containers::MapGetValuePtr(_areaTriggerCreateProperties, createPropertiesId);
273 if (!createProperties)
274 {
275 TC_LOG_ERROR("sql.sql", "Table `areatrigger_create_properties_orbit` reference invalid AreaTriggerCreatePropertiesId: (Id: {}, IsCustom: {})", createPropertiesId.Id, uint32(createPropertiesId.IsCustom));
276 continue;
277 }
278
279 createProperties->OrbitInfo.emplace();
280
281 createProperties->OrbitInfo->StartDelay = circularMovementInfoFields[2].GetUInt32();
282
283#define VALIDATE_AND_SET_FLOAT(Float, Value) \
284 createProperties->OrbitInfo->Float = Value; \
285 if (!std::isfinite(createProperties->OrbitInfo->Float)) \
286 { \
287 TC_LOG_ERROR("sql.sql", "Table `areatrigger_create_properties_orbit` has listed areatrigger (AreaTriggerCreatePropertiesId: {}, IsCustom: {}) with invalid " #Float " ({}), set to 0!", \
288 createPropertiesId.Id, uint32(createPropertiesId.IsCustom), createProperties->OrbitInfo->Float); \
289 createProperties->OrbitInfo->Float = 0.0f; \
290 }
291
292 VALIDATE_AND_SET_FLOAT(Radius, circularMovementInfoFields[3].GetFloat());
293 VALIDATE_AND_SET_FLOAT(BlendFromRadius, circularMovementInfoFields[4].GetFloat());
294 VALIDATE_AND_SET_FLOAT(InitialAngle, circularMovementInfoFields[5].GetFloat());
295 VALIDATE_AND_SET_FLOAT(ZOffset, circularMovementInfoFields[6].GetFloat());
296
297#undef VALIDATE_AND_SET_FLOAT
298
299 createProperties->OrbitInfo->CounterClockwise = circularMovementInfoFields[7].GetBool();
300 createProperties->OrbitInfo->CanLoop = circularMovementInfoFields[8].GetBool();
301 }
302 while (circularMovementInfos->NextRow());
303 }
304 else
305 {
306 TC_LOG_INFO("server.loading", ">> Loaded 0 AreaTrigger templates circular movement infos. DB table `areatrigger_create_properties_orbit` is empty.");
307 }
308
309 TC_LOG_INFO("server.loading", ">> Loaded {} spell areatrigger templates in {} ms.", _areaTriggerTemplateStore.size(), GetMSTimeDiffToNow(oldMSTime));
310}
311
313{
314 // build single time for check spawnmask
315 std::unordered_map<uint32, std::set<Difficulty>> spawnMasks;
316 for (MapDifficultyEntry const* mapDifficulty : sMapDifficultyStore)
317 spawnMasks[mapDifficulty->MapID].insert(Difficulty(mapDifficulty->DifficultyID));
318
319 uint32 oldMSTime = getMSTime();
320 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13
321 if (QueryResult templates = WorldDatabase.Query("SELECT SpawnId, AreaTriggerCreatePropertiesId, IsCustom, MapId, SpawnDifficulties, PosX, PosY, PosZ, Orientation, PhaseUseFlags, PhaseId, PhaseGroup, SpellForVisuals, ScriptName FROM `areatrigger`"))
322 {
323 do
324 {
325 Field* fields = templates->Fetch();
326
327 ObjectGuid::LowType spawnId = fields[0].GetUInt64();
328 AreaTriggerCreatePropertiesId createPropertiesId = { fields[1].GetUInt32(), fields[2].GetBool() };
329 WorldLocation location(fields[3].GetUInt32(), fields[5].GetFloat(), fields[6].GetFloat(), fields[7].GetFloat(), fields[8].GetFloat());
330
331 AreaTriggerCreateProperties const* createProperties = GetAreaTriggerCreateProperties(createPropertiesId);
332 if (!createProperties)
333 {
334 TC_LOG_ERROR("sql.sql", "Table `areatrigger` has listed AreaTriggerCreatePropertiesId (Id: {}, IsCustom: {}) that doesn't exist for SpawnId " UI64FMTD,
335 createPropertiesId.Id, uint32(createPropertiesId.IsCustom), spawnId);
336 continue;
337 }
338
339 if (createProperties->Flags != AreaTriggerCreatePropertiesFlag::None)
340 {
341 TC_LOG_ERROR("sql.sql", "Table `areatrigger` has listed AreaTriggerCreatePropertiesId (Id: {}, IsCustom: {}) with non - zero flags",
342 createPropertiesId.Id, uint32(createPropertiesId.IsCustom));
343 continue;
344 }
345
346 if (createProperties->ScaleCurveId || createProperties->MorphCurveId || createProperties->FacingCurveId || createProperties->MoveCurveId)
347 {
348 TC_LOG_ERROR("sql.sql", "Table `areatrigger` has listed AreaTriggerCreatePropertiesId (Id: {}, IsCustom: {}) with curve values",
349 createPropertiesId.Id, uint32(createPropertiesId.IsCustom));
350 continue;
351 }
352
353 if (createProperties->TimeToTarget || createProperties->TimeToTargetScale || createProperties->FacingCurveId || createProperties->MoveCurveId)
354 {
355 TC_LOG_ERROR("sql.sql", "Table `areatrigger` has listed AreaTriggerCreatePropertiesId (Id: {}, IsCustom: {}) with time to target values",
356 createPropertiesId.Id, uint32(createPropertiesId.IsCustom));
357 continue;
358 }
359
360 if (createProperties->OrbitInfo)
361 {
362 TC_LOG_ERROR("sql.sql", "Table `areatrigger` has listed AreaTriggerCreatePropertiesId (Id: {}, IsCustom: {}) with orbit info",
363 createPropertiesId.Id, uint32(createPropertiesId.IsCustom));
364 continue;
365 }
366
367 if (createProperties->HasSplines())
368 {
369 TC_LOG_ERROR("sql.sql", "Table `areatrigger` has listed AreaTriggerCreatePropertiesId (Id: {}, IsCustom: {}) with splines",
370 createPropertiesId.Id, uint32(createPropertiesId.IsCustom));
371 continue;
372 }
373
374 if (!MapManager::IsValidMapCoord(location))
375 {
376 TC_LOG_ERROR("sql.sql", "Table `areatrigger` has listed an invalid position: SpawnId: {}, MapId {}, Position {{}}",
377 spawnId, location.GetMapId(), location.ToString());
378 continue;
379 }
380
381 std::vector<Difficulty> difficulties = sObjectMgr->ParseSpawnDifficulties(fields[4].GetStringView(), "areatrigger", spawnId, location.GetMapId(), spawnMasks[location.GetMapId()]);
382 if (difficulties.empty())
383 {
384 TC_LOG_DEBUG("sql.sql", "Table `areatrigger` has areatrigger (GUID: {}) that is not spawned in any difficulty, skipped.", spawnId);
385 continue;
386 }
387
388 AreaTriggerSpawn& spawn = _areaTriggerSpawnsBySpawnId[spawnId];
389 spawn.spawnId = spawnId;
390 spawn.mapId = location.GetMapId();
391 spawn.Id = createPropertiesId;
392 spawn.spawnPoint.Relocate(location);
393
394 spawn.phaseUseFlags = fields[9].GetUInt8();
395 spawn.phaseId = fields[10].GetUInt32();
396 spawn.phaseGroup = fields[11].GetUInt32();
397
398 if (!fields[12].IsNull())
399 {
400 spawn.SpellForVisuals = fields[12].GetInt32();
401 if (!sSpellMgr->GetSpellInfo(spawn.SpellForVisuals.value(), DIFFICULTY_NONE))
402 {
403 TC_LOG_ERROR("sql.sql", "Table `areatrigger` has areatrigger (GUID: {}) with invalid SpellForVisual {}, set to none.", spawnId, *spawn.SpellForVisuals);
404 spawn.SpellForVisuals.reset();
405 }
406 }
407
408 spawn.scriptId = sObjectMgr->GetScriptId(fields[13].GetString());
409 spawn.spawnGroupData = sObjectMgr->GetLegacySpawnGroup();
410
411 // Add the trigger to a map::cell map, which is later used by GridLoader to query
413 for (Difficulty difficulty : difficulties)
414 _areaTriggerSpawnsByLocation[{ spawn.mapId, difficulty }][cellCoord.GetId()].insert(spawnId);
415 } while (templates->NextRow());
416 }
417
418 TC_LOG_INFO("server.loading", ">> Loaded {} areatrigger spawns in {} ms.", _areaTriggerSpawnsBySpawnId.size(), GetMSTimeDiffToNow(oldMSTime));
419}
420
422{
423 return Trinity::Containers::MapGetValuePtr(_areaTriggerTemplateStore, areaTriggerId);
424}
425
427{
428 return Trinity::Containers::MapGetValuePtr(_areaTriggerCreateProperties, areaTriggerCreatePropertiesId);
429}
430
431std::set<ObjectGuid::LowType> const* AreaTriggerDataStore::GetAreaTriggersForMapAndCell(uint32 mapId, Difficulty difficulty, uint32 cellId) const
432{
433 if (auto* atForMapAndDifficulty = Trinity::Containers::MapGetValuePtr(_areaTriggerSpawnsByLocation, { mapId, difficulty }))
434 return Trinity::Containers::MapGetValuePtr(*atForMapAndDifficulty, cellId);
435
436 return nullptr;
437}
438
440{
441 return Trinity::Containers::MapGetValuePtr(_areaTriggerSpawnsBySpawnId, spawnId);
442}
443
445{
446 static AreaTriggerDataStore instance;
447 return &instance;
448}
#define VALIDATE_AND_SET_CURVE(Curve, Value)
#define VALIDATE_AND_SET_FLOAT(Float, Value)
AreaTriggerCreatePropertiesFlag
#define MAX_AREATRIGGER_ENTITY_DATA
AreaTriggerActionTypes
@ AREATRIGGER_ACTION_TELEPORT
@ AREATRIGGER_ACTION_MAX
AreaTriggerFlag
AreaTriggerShapeType
AreaTriggerActionUserTypes
@ AREATRIGGER_ACTION_USER_MAX
DB2Storage< MapDifficultyEntry > sMapDifficultyStore("MapDifficulty.db2", &MapDifficultyLoadInfo::Instance)
Difficulty
Definition: DBCEnums.h:873
@ DIFFICULTY_NONE
Definition: DBCEnums.h:874
std::shared_ptr< ResultSet > QueryResult
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
#define UI64FMTD
Definition: Define.h:126
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:156
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:165
#define TC_LOG_INFO(filterType__,...)
Definition: Log.h:159
#define sObjectMgr
Definition: ObjectMgr.h:1946
#define sSpellMgr
Definition: SpellMgr.h:849
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:57
uint32 getMSTime()
Definition: Timer.h:33
EnumFlag< AreaTriggerCreatePropertiesFlag > Flags
AreaTriggerCreatePropertiesId Id
Optional< AreaTriggerOrbitInfo > OrbitInfo
AreaTriggerTemplate const * Template
std::vector< Position > SplinePoints
AreaTriggerTemplate const * GetAreaTriggerTemplate(AreaTriggerId const &areaTriggerId) const
AreaTriggerCreateProperties const * GetAreaTriggerCreateProperties(AreaTriggerCreatePropertiesId const &areaTriggerCreatePropertiesId) const
std::set< ObjectGuid::LowType > const * GetAreaTriggersForMapAndCell(uint32 mapId, Difficulty difficulty, uint32 cellId) const
AreaTriggerSpawn const * GetAreaTriggerSpawn(ObjectGuid::LowType spawnId) const
static AreaTriggerDataStore * Instance()
std::vector< AreaTriggerAction > Actions
EnumFlag< AreaTriggerFlag > Flags
Class used to access individual fields of database query result.
Definition: Field.h:90
uint8 GetUInt8() const
Definition: Field.cpp:30
uint64 GetUInt64() const
Definition: Field.cpp:78
float GetFloat() const
Definition: Field.cpp:94
bool GetBool() const
Definition: Field.h:98
uint32 GetUInt32() const
Definition: Field.cpp:62
int32 GetInt32() const
Definition: Field.cpp:70
static bool IsValidMapCoord(uint32 mapid, float x, float y)
Definition: MapManager.h:82
uint64 LowType
Definition: ObjectGuid.h:278
constexpr uint32 GetMapId() const
Definition: Position.h:201
auto MapGetValuePtr(M &map, typename M::key_type const &key)
Definition: MapUtils.h:29
void hash_combine(std::size_t &seed, T const &val)
Definition: Hash.h:28
CellCoord ComputeCellCoord(float x, float y)
Definition: GridDefines.h:206
AreaTriggerActionTypes ActionType
AreaTriggerActionUserTypes TargetType
std::vector< TaggedPosition< Position::XY > > PolygonVertices
AreaTriggerShapeType Type
std::vector< TaggedPosition< Position::XY > > PolygonVerticesTarget
struct AreaTriggerShapeInfo::@199::@204 PolygonDatas
struct AreaTriggerShapeInfo::@199::@201 DefaultDatas
float Data[MAX_AREATRIGGER_ENTITY_DATA]
Optional< int32 > SpellForVisuals
AreaTriggerCreatePropertiesId Id
uint32 GetId() const
Definition: GridDefines.h:166
constexpr float GetPositionX() const
Definition: Position.h:76
constexpr float GetPositionY() const
Definition: Position.h:77
std::string ToString() const
Definition: Position.cpp:128
constexpr void Relocate(float x, float y)
Definition: Position.h:63
uint32 scriptId
Definition: SpawnData.h:113
uint8 phaseUseFlags
Definition: SpawnData.h:106
uint32 phaseId
Definition: SpawnData.h:107
Position spawnPoint
Definition: SpawnData.h:105
uint32 phaseGroup
Definition: SpawnData.h:108
SpawnGroupTemplateData const * spawnGroupData
Definition: SpawnData.h:96
uint64 spawnId
Definition: SpawnData.h:93
uint32 mapId
Definition: SpawnData.h:94
std::size_t operator()(AreaTriggerId const &value) const noexcept