aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOvah <dreadkiller@gmx.de>2020-11-17 23:41:15 +0100
committerShauren <shauren.trinity@gmail.com>2022-03-01 21:46:43 +0100
commit203dfec2a1d1d628469ed0d68fefac33c15e65d6 (patch)
tree996b037dd02b2e279ed0fad370493783258150df
parent191fea6055a323ad0a044f6ad47a2af697682ed3 (diff)
Core/Maps: add new FLAG_ALLIANCE_ONLY and FLAG_HORDE_ONLY for instance spawn groups (PR #25656)
(cherry picked from commit 4abbeb2a60370157bc9a72e5c566c1112ff904e9)
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp6
-rw-r--r--src/server/game/Globals/ObjectMgr.h6
-rw-r--r--src/server/game/Instances/InstanceScript.cpp3
3 files changed, 13 insertions, 2 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index ad8dd328747..8f3bf2ebea2 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -2886,6 +2886,12 @@ void ObjectMgr::LoadInstanceSpawnGroups()
else
info.Flags = flags;
+ if ((flags & InstanceSpawnGroupInfo::FLAG_ALLIANCE_ONLY) && (flags & InstanceSpawnGroupInfo::FLAG_HORDE_ONLY))
+ {
+ info.Flags = flags & ~(InstanceSpawnGroupInfo::FLAG_ALLIANCE_ONLY | InstanceSpawnGroupInfo::FLAG_HORDE_ONLY);
+ TC_LOG_ERROR("sql.sql", "Instance spawn group (%u,%u) FLAG_ALLIANCE_ONLY and FLAG_HORDE_ONLY may not be used together in a single entry - truncated to %u.", instanceMapId, spawnGroupId, info.Flags);
+ }
+
++n;
} while (result->NextRow());
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 07ee9996ecb..9015d9a76c7 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -435,9 +435,11 @@ struct TC_GAME_API InstanceSpawnGroupInfo
enum
{
FLAG_ACTIVATE_SPAWN = 0x01,
- FLAG_BLOCK_SPAWN = 0x02,
+ FLAG_BLOCK_SPAWN = 0x02,
+ FLAG_ALLIANCE_ONLY = 0x04,
+ FLAG_HORDE_ONLY = 0x08,
- FLAG_ALL = (FLAG_ACTIVATE_SPAWN | FLAG_BLOCK_SPAWN)
+ FLAG_ALL = (FLAG_ACTIVATE_SPAWN | FLAG_BLOCK_SPAWN | FLAG_ALLIANCE_ONLY | FLAG_HORDE_ONLY)
};
uint8 BossStateId;
uint8 BossStates;
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp
index 8df7d06cdfb..04ac053231e 100644
--- a/src/server/game/Instances/InstanceScript.cpp
+++ b/src/server/game/Instances/InstanceScript.cpp
@@ -262,6 +262,9 @@ void InstanceScript::UpdateSpawnGroups()
continue;
if (!((1 << GetBossState(info.BossStateId)) & info.BossStates))
continue;
+ if (((instance->GetTeamIdInInstance() == TEAM_ALLIANCE) && (info.Flags & InstanceSpawnGroupInfo::FLAG_HORDE_ONLY))
+ || ((instance->GetTeamIdInInstance() == TEAM_HORDE) && (info.Flags & InstanceSpawnGroupInfo::FLAG_ALLIANCE_ONLY)))
+ continue;
if (info.Flags & InstanceSpawnGroupInfo::FLAG_BLOCK_SPAWN)
curValue = FORCEBLOCK;
else if (info.Flags & InstanceSpawnGroupInfo::FLAG_ACTIVATE_SPAWN)