aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/DataStores/DBCStores.cpp2
-rw-r--r--src/server/game/DataStores/DBCStores.h1
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp25
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.h4
-rw-r--r--src/server/shared/DataStores/DBCStructure.h12
-rw-r--r--src/server/shared/DataStores/DBCfmt.h1
6 files changed, 36 insertions, 9 deletions
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 544c0a61f2e..cddb7a3c2c5 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -123,6 +123,7 @@ DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
DBCStorage <LFGDungeonEntry> sLFGDungeonStore(LFGDungeonEntryfmt);
+DBCStorage <LFGDungeonExpansionEntry> sLFGDungeonExpansionStore(LFGDungeonExpansionfmt);
DBCStorage <LightEntry> sLightStore(LightEntryfmt);
DBCStorage <LiquidTypeEntry> sLiquidTypeStore(LiquidTypefmt);
DBCStorage <LockEntry> sLockStore(LockEntryfmt);
@@ -346,6 +347,7 @@ void LoadDBCStores(const std::string& dataPath)
LOAD_DBC(sItemRandomSuffixStore, "ItemRandomSuffix.dbc");
LOAD_DBC(sItemSetStore, "ItemSet.dbc");
LOAD_DBC(sLFGDungeonStore, "LFGDungeons.dbc");
+ LOAD_DBC(sLFGDungeonExpansionStore, "LFGDungeonExpansion.dbc");
LOAD_DBC(sLightStore, "Light.dbc");
LOAD_DBC(sLiquidTypeStore, "LiquidType.dbc");
LOAD_DBC(sLockStore, "Lock.dbc");
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index 0ac62982c18..c1635c47158 100644
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -152,6 +152,7 @@ TC_GAME_API extern DBCStorage <ItemRandomPropertiesEntry> sItemRandomProperti
TC_GAME_API extern DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore;
TC_GAME_API extern DBCStorage <ItemSetEntry> sItemSetStore;
TC_GAME_API extern DBCStorage <LFGDungeonEntry> sLFGDungeonStore;
+TC_GAME_API extern DBCStorage <LFGDungeonExpansionEntry> sLFGDungeonExpansionStore;
TC_GAME_API extern DBCStorage <LightEntry> sLightStore;
TC_GAME_API extern DBCStorage <LiquidTypeEntry> sLiquidTypeStore;
TC_GAME_API extern DBCStorage <LockEntry> sLockStore;
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 3e4bc2c92e3..e39d5f9c0db 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -31,6 +31,7 @@
#include "LFGQueue.h"
#include "Log.h"
#include "Map.h"
+#include "MapUtils.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Player.h"
@@ -43,15 +44,16 @@
namespace lfg
{
-LFGDungeonData::LFGDungeonData() : id(0), name(), map(0), type(0), expansion(0), group(0), minlevel(0),
- maxlevel(0), difficulty(REGULAR_DIFFICULTY), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
+LFGDungeonData::LFGDungeonData() : id(0), name(), map(0), type(0), expansion(0), group(0), minlevel(),
+ maxlevel(), difficulty(REGULAR_DIFFICULTY), seasonal(false), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
{
}
LFGDungeonData::LFGDungeonData(LFGDungeonEntry const* dbc) : id(dbc->ID), name(dbc->Name[0]), map(dbc->MapID),
type(dbc->TypeID), expansion(uint8(dbc->ExpansionLevel)), group(uint8(dbc->GroupID)),
- minlevel(uint8(dbc->MinLevel)), maxlevel(uint8(dbc->MaxLevel)), difficulty(Difficulty(dbc->Difficulty)),
- seasonal((dbc->Flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
+ minlevel({ uint8(dbc->MinLevel), uint8(dbc->MinLevel), uint8(dbc->MinLevel) }),
+ maxlevel({ uint8(dbc->MaxLevel), uint8(dbc->MaxLevel), uint8(dbc->MaxLevel) }),
+ difficulty(Difficulty(dbc->Difficulty)), seasonal((dbc->Flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
{
}
@@ -209,6 +211,15 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
}
}
+ for (LFGDungeonExpansionEntry const* dungeonExpansion : sLFGDungeonExpansionStore)
+ {
+ if (LFGDungeonData* dungeon = Trinity::Containers::MapGetValuePtr(LfgDungeonStore, dungeonExpansion->LfgID))
+ {
+ dungeon->minlevel[dungeonExpansion->ExpansionLevel] = dungeonExpansion->HardLevelMin;
+ dungeon->maxlevel[dungeonExpansion->ExpansionLevel] = dungeonExpansion->HardLevelMax;
+ }
+ }
+
// Fill teleport locations from DB
// 0 1 2 3 4
QueryResult result = WorldDatabase.Query("SELECT dungeonId, position_x, position_y, position_z, orientation FROM lfg_dungeon_template");
@@ -1700,9 +1711,9 @@ LfgLockMap const LFGMgr::GetLockedDungeons(ObjectGuid guid)
lockData = LFG_LOCKSTATUS_RAID_LOCKED;
else if (dungeon->difficulty > DUNGEON_DIFFICULTY_NORMAL && player->GetBoundInstance(dungeon->map, Difficulty(dungeon->difficulty)))
lockData = LFG_LOCKSTATUS_RAID_LOCKED;
- else if (dungeon->minlevel > level)
+ else if (dungeon->minlevel[expansion] > level)
lockData = LFG_LOCKSTATUS_TOO_LOW_LEVEL;
- else if (dungeon->maxlevel < level)
+ else if (dungeon->maxlevel[expansion] < level)
lockData = LFG_LOCKSTATUS_TOO_HIGH_LEVEL;
else if (dungeon->seasonal && !IsSeasonActive(dungeon->id))
lockData = LFG_LOCKSTATUS_NOT_IN_SEASON;
@@ -2134,7 +2145,7 @@ LfgDungeonSet LFGMgr::GetRandomAndSeasonalDungeons(uint8 level, uint8 expansion)
{
lfg::LFGDungeonData const& dungeon = itr->second;
if ((dungeon.type == lfg::LFG_TYPE_RANDOM || (dungeon.seasonal && sLFGMgr->IsSeasonActive(dungeon.id)))
- && dungeon.expansion <= expansion && dungeon.minlevel <= level && level <= dungeon.maxlevel)
+ && dungeon.expansion <= expansion && dungeon.minlevel[expansion] <= level && level <= dungeon.maxlevel[expansion])
randomDungeons.insert(dungeon.Entry());
}
return randomDungeons;
diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h
index 3d9109677c0..71ef7f35a5e 100644
--- a/src/server/game/DungeonFinding/LFGMgr.h
+++ b/src/server/game/DungeonFinding/LFGMgr.h
@@ -290,8 +290,8 @@ struct LFGDungeonData
uint8 type;
uint8 expansion;
uint8 group;
- uint8 minlevel;
- uint8 maxlevel;
+ std::array<uint8, MAX_EXPANSIONS> minlevel;
+ std::array<uint8, MAX_EXPANSIONS> maxlevel;
Difficulty difficulty;
bool seasonal;
float x, y, z, o;
diff --git a/src/server/shared/DataStores/DBCStructure.h b/src/server/shared/DataStores/DBCStructure.h
index e2c12efee36..53ef620bcd9 100644
--- a/src/server/shared/DataStores/DBCStructure.h
+++ b/src/server/shared/DataStores/DBCStructure.h
@@ -1013,6 +1013,18 @@ struct LFGDungeonEntry
uint32 Entry() const { return ID + (TypeID << 24); }
};
+struct LFGDungeonExpansionEntry
+{
+ //uint32 ID; // 0
+ uint32 LfgID; // 1
+ uint32 ExpansionLevel; // 2
+ //uint32 RandomID; // 3
+ uint32 HardLevelMin; // 4
+ uint32 HardLevelMax; // 5
+ //uint32 TargetLevelMin; // 6
+ //uint32 TargetLevelMax; // 7
+};
+
struct LightEntry
{
uint32 ID; // 0
diff --git a/src/server/shared/DataStores/DBCfmt.h b/src/server/shared/DataStores/DBCfmt.h
index 69d4e5f8dcc..da8e920df93 100644
--- a/src/server/shared/DataStores/DBCfmt.h
+++ b/src/server/shared/DataStores/DBCfmt.h
@@ -84,6 +84,7 @@ char constexpr ItemRandomPropertiesfmt[] = "nxiiixxssssssssssssssssx";
char constexpr ItemRandomSuffixfmt[] = "nssssssssssssssssxxiiixxiiixx";
char constexpr ItemSetEntryfmt[] = "dssssssssssssssssxiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii";
char constexpr LFGDungeonEntryfmt[] = "nssssssssssssssssxiiiiiiiiixxixixxxxxxxxxxxxxxxxx";
+char constexpr LFGDungeonExpansionfmt[] = "diixiixx";
char constexpr LightEntryfmt[] = "nifffxxxxxxxxxx";
char constexpr LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char constexpr LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";