aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/SpawnData.h
diff options
context:
space:
mode:
authorr00ty-tc <r00ty-tc@users.noreply.github.com>2017-05-07 21:48:41 +0100
committerShauren <shauren.trinity@gmail.com>2020-08-22 12:59:57 +0200
commit03b125e6d1947258316c931499746696a95aded2 (patch)
tree34d7ebc57cd3669d6d1a118e1491d3ecf353470a /src/server/game/Maps/SpawnData.h
parentbf5be2839652e038eeb87c9fa301fd9dd6de8982 (diff)
Dynamic Creature/Go spawning:
- True blizzlike creature spawn/respawn behavior - new creature = new object - Toggleable spawn groups (with C++/SAI/command options to use them) - Custom feature: dynamic spawn rate scaling. Accelerates respawn rate based on players in the zone. - Backward compatibility mode (set via group and for summons) to support creatures/gos that currently don't work well with this (this should be removed once the exceptions are fixed) Fixes and closes #2858 Tags #8661 as fixable. Fixes and closes #13787 Fixes #15222. (cherry picked from commit 59db2eeea0a35028779fd76372ae06cc98c8086f)
Diffstat (limited to 'src/server/game/Maps/SpawnData.h')
-rw-r--r--src/server/game/Maps/SpawnData.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/server/game/Maps/SpawnData.h b/src/server/game/Maps/SpawnData.h
new file mode 100644
index 00000000000..5d0c8d17e9d
--- /dev/null
+++ b/src/server/game/Maps/SpawnData.h
@@ -0,0 +1,82 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TRINITY_SPAWNDATA_H
+#define TRINITY_SPAWNDATA_H
+
+#include "DBCEnums.h"
+#include "Position.h"
+#include <vector>
+
+enum SpawnObjectType
+{
+ SPAWN_TYPE_CREATURE = 0,
+ SPAWN_TYPE_GAMEOBJECT = 1,
+
+ SPAWN_TYPE_MAX
+};
+
+enum SpawnObjectTypeMask
+{
+ SPAWN_TYPEMASK_CREATURE = (1 << SPAWN_TYPE_CREATURE),
+ SPAWN_TYPEMASK_GAMEOBJECT = (1 << SPAWN_TYPE_GAMEOBJECT),
+
+ SPAWN_TYPEMASK_ALL = (1 << SPAWN_TYPE_MAX)-1
+};
+
+enum SpawnGroupFlags
+{
+ SPAWNGROUP_FLAG_NONE = 0x00,
+ SPAWNGROUP_FLAG_SYSTEM = 0x01,
+ SPAWNGROUP_FLAG_COMPATIBILITY_MODE = 0x02,
+ SPAWNGROUP_FLAG_MANUAL_SPAWN = 0x04,
+ SPAWNGROUP_FLAG_DYNAMIC_SPAWN_RATE = 0x08,
+ SPAWNGROUP_FLAG_ESCORTQUESTNPC = 0x10,
+
+ SPAWNGROUP_FLAGS_ALL = (SPAWNGROUP_FLAG_SYSTEM | SPAWNGROUP_FLAG_COMPATIBILITY_MODE | SPAWNGROUP_FLAG_MANUAL_SPAWN | SPAWNGROUP_FLAG_DYNAMIC_SPAWN_RATE | SPAWNGROUP_FLAG_ESCORTQUESTNPC)
+};
+
+struct SpawnGroupTemplateData
+{
+ uint32 groupId;
+ std::string name;
+ uint32 mapId;
+ SpawnGroupFlags flags;
+ bool isActive;
+};
+
+struct SpawnData
+{
+ SpawnObjectType const type;
+ uint64 spawnId = 0;
+ uint32 id = 0; // entry in respective _template table
+ WorldLocation spawnPoint;
+ uint8 phaseUseFlags = 0;
+ uint32 phaseId = 0;
+ uint32 phaseGroup = 0;
+ int32 terrainSwapMap = -1;
+ int32 spawntimesecs = 0;
+ std::vector<Difficulty> spawnDifficulties;
+ SpawnGroupTemplateData const* spawnGroupData = nullptr;
+ uint32 scriptId = 0;
+ bool dbData = true;
+
+ protected:
+ SpawnData(SpawnObjectType t) : type(t) {}
+};
+
+#endif