mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Maps: add new FLAG_ALLIANCE_ONLY and FLAG_HORDE_ONLY for instance spawn groups (PR #25656)
This commit is contained in:
@@ -2718,6 +2718,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());
|
||||
|
||||
|
||||
@@ -428,9 +428,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;
|
||||
|
||||
@@ -249,6 +249,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)
|
||||
|
||||
Reference in New Issue
Block a user