mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 01:53:47 +00:00
Core/Instance: Shared normal/heroic ID is now a configurable feature (default: deactivated)
This commit is contained in:
@@ -856,6 +856,11 @@ PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattlegroundB
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool IsSharedDifficultyMap(uint32 mapid)
|
||||
{
|
||||
return sWorld->getBoolConfig(CONFIG_INSTANCE_SHARED_ID) && (mapid == 631 || mapid == 724);
|
||||
}
|
||||
|
||||
uint32 GetLiquidFlags(uint32 liquidType)
|
||||
{
|
||||
if (LiquidTypeEntry const* liq = sLiquidTypeStore.LookupEntry(liquidType))
|
||||
|
||||
@@ -44,6 +44,8 @@ typedef std::map<uint32/*pair32(map, diff)*/, MapDifficulty> MapDifficultyMap;
|
||||
MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty);
|
||||
MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty);
|
||||
|
||||
bool IsSharedDifficultyMap(uint32 mapid);
|
||||
|
||||
uint32 GetLiquidFlags(uint32 liquidType);
|
||||
|
||||
PvPDifficultyEntry const* GetBattlegroundBracketByLevel(uint32 mapid, uint32 level);
|
||||
|
||||
@@ -1508,7 +1508,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((groupGuy->GetMap()->GetId() == 631 || groupGuy->GetMap()->GetId() == 724) && mode%2 == _player->GetRaidDifficulty()%2 && group->isRaidGroup())
|
||||
if (IsSharedDifficultyMap(groupGuy->GetMap()->GetId()) && mode%2 == _player->GetRaidDifficulty()%2 && group->isRaidGroup())
|
||||
{
|
||||
if (!currMap)
|
||||
currMap = groupGuy->GetMap();
|
||||
@@ -1592,7 +1592,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data)
|
||||
if (!groupGuy)
|
||||
continue;
|
||||
|
||||
if (groupGuy->GetMap()->GetId() == 631 || groupGuy->GetMap()->GetId() == 724)
|
||||
if (IsSharedDifficultyMap(groupGuy->GetMap()->GetId()))
|
||||
{
|
||||
anyoneInside = true;
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ bool InstanceSaveManager::DeleteInstanceSaveIfNeeded(InstanceSave* save, bool sk
|
||||
}
|
||||
|
||||
InstanceSave::InstanceSave(uint16 MapId, uint32 InstanceId, Difficulty difficulty, time_t resetTime, time_t extendedResetTime)
|
||||
: m_resetTime(resetTime), m_extendedResetTime(extendedResetTime), m_instanceid(InstanceId), m_mapid(MapId), m_difficulty(MapId == 631 || MapId == 724 ? Difficulty(difficulty%2) : difficulty), m_canReset(true), m_instanceData(""), m_completedEncounterMask(0)
|
||||
: m_resetTime(resetTime), m_extendedResetTime(extendedResetTime), m_instanceid(InstanceId), m_mapid(MapId), m_difficulty(IsSharedDifficultyMap(MapId) ? Difficulty(difficulty%2) : difficulty), m_canReset(true), m_instanceData(""), m_completedEncounterMask(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -676,7 +676,8 @@ void InstanceSaveManager::PlayerUnbindInstanceNotExtended(uint32 guidLow, uint32
|
||||
|
||||
InstancePlayerBind* InstanceSaveManager::PlayerGetBoundInstance(uint32 guidLow, uint32 mapid, Difficulty difficulty)
|
||||
{
|
||||
Difficulty difficulty_fixed = (mapid == 631 || mapid == 724 ? Difficulty(difficulty%2) : difficulty);
|
||||
Difficulty difficulty_fixed = ( IsSharedDifficultyMap(mapid) ? Difficulty(difficulty%2) : difficulty);
|
||||
|
||||
MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty_fixed);
|
||||
if (!mapDiff)
|
||||
return NULL;
|
||||
|
||||
@@ -2974,7 +2974,7 @@ void Map::DeleteRespawnTimesInDB(uint16 mapId, uint32 instanceId)
|
||||
|
||||
void Map::UpdateEncounterState(EncounterCreditType type, uint32 creditEntry, Unit* source)
|
||||
{
|
||||
Difficulty difficulty_fixed = (GetId() == 631 || GetId() == 724 ? Difficulty(GetDifficulty()%2) : GetDifficulty());
|
||||
Difficulty difficulty_fixed = (IsSharedDifficultyMap(GetId()) ? Difficulty(GetDifficulty()%2) : GetDifficulty());
|
||||
DungeonEncounterList const* encounters = sObjectMgr->GetDungeonEncounterList(GetId(), difficulty_fixed);
|
||||
if (!encounters)
|
||||
return;
|
||||
|
||||
@@ -139,7 +139,7 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player)
|
||||
map = FindInstanceMap(destInstId);
|
||||
if (!map)
|
||||
map = CreateInstance(destInstId, pSave, realdiff);
|
||||
else if ((mapId == 631 || mapId == 724) && !map->HavePlayers() && map->GetDifficulty() != realdiff)
|
||||
else if (IsSharedDifficultyMap(mapId) && !map->HavePlayers() && map->GetDifficulty() != realdiff)
|
||||
{
|
||||
if (player->isBeingLoaded()) // pussywizard: crashfix (assert(passengers.empty) fail in ~transport), could be added to a transport during loading from db
|
||||
return NULL;
|
||||
|
||||
@@ -858,6 +858,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
m_bool_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfigMgr->GetBoolDefault("Instance.IgnoreLevel", false);
|
||||
m_bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfigMgr->GetBoolDefault("Instance.IgnoreRaid", false);
|
||||
m_bool_configs[CONFIG_INSTANCE_SHARED_ID] = sConfigMgr->GetBoolDefault("Instance.SharedNormalHeroicId", false);
|
||||
|
||||
m_int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfigMgr->GetIntDefault("Instance.ResetTimeHour", 4);
|
||||
m_int_configs[CONFIG_INSTANCE_RESET_TIME_RELATIVE_TIMESTAMP] = sConfigMgr->GetIntDefault("Instance.ResetTimeRelativeTimestamp", 1135814400);
|
||||
|
||||
@@ -93,6 +93,7 @@ enum WorldBoolConfigs
|
||||
CONFIG_INSTANT_TAXI,
|
||||
CONFIG_INSTANCE_IGNORE_LEVEL,
|
||||
CONFIG_INSTANCE_IGNORE_RAID,
|
||||
CONFIG_INSTANCE_SHARED_ID,
|
||||
CONFIG_GM_LOG_TRADE,
|
||||
CONFIG_ALLOW_GM_GROUP,
|
||||
CONFIG_ALLOW_GM_FRIEND,
|
||||
|
||||
Reference in New Issue
Block a user