update (core\store): sLFGDungeonStore update (#15325)

* update (core\store): sLFGDungeonStore update

update (core\store): sLFGDungeonStore update

Co-Authored-By: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* update (core\store): sLFGDungeonStore update

Co-Authored-By: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

---------

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
M'Dic
2023-04-29 06:25:49 -04:00
committed by GitHub
parent 2e98e7c42a
commit e5665c32f8
8 changed files with 90 additions and 29 deletions
@@ -0,0 +1,52 @@
DROP TABLE IF EXISTS `lfgdungeons_dbc`;
CREATE TABLE `lfgdungeons_dbc` (
`ID` INT NOT NULL DEFAULT '0',
`Name_Lang_enUS` TEXT NULL,
`Name_Lang_enGB` TEXT NULL,
`Name_Lang_koKR` TEXT NULL,
`Name_Lang_frFR` TEXT NULL,
`Name_Lang_deDE` TEXT NULL,
`Name_Lang_enCN` TEXT NULL,
`Name_Lang_zhCN` TEXT NULL,
`Name_Lang_enTW` TEXT NULL,
`Name_Lang_zhTW` TEXT NULL,
`Name_Lang_esES` TEXT NULL,
`Name_Lang_esMX` TEXT NULL,
`Name_Lang_ruRU` TEXT NULL,
`Name_Lang_ptPT` TEXT NULL,
`Name_Lang_ptBR` TEXT NULL,
`Name_Lang_itIT` TEXT NULL,
`Name_Lang_Unk` TEXT NULL,
`Name_Lang_Mask` INT UNSIGNED NOT NULL DEFAULT '0',
`MinLevel` INT NOT NULL DEFAULT '0',
`MaxLevel` INT NOT NULL DEFAULT '0',
`Target_Level` INT NOT NULL DEFAULT '0',
`Target_Level_Min` INT NOT NULL DEFAULT '0',
`Target_Level_Max` INT NOT NULL DEFAULT '0',
`MapID` INT NOT NULL DEFAULT '0',
`Difficulty` INT NOT NULL DEFAULT '0',
`Flags` INT NOT NULL DEFAULT '0',
`TypeID` INT NOT NULL DEFAULT '0',
`Faction` INT NOT NULL DEFAULT '0',
`TextureFilename` TEXT NULL,
`ExpansionLevel` INT NOT NULL DEFAULT '0',
`Order_Index` INT NOT NULL DEFAULT '0',
`Group_Id` INT NOT NULL DEFAULT '0',
`Description_Lang_enUS` TEXT NULL,
`Description_Lang_enGB` TEXT NULL,
`Description_Lang_koKR` TEXT NULL,
`Description_Lang_frFR` TEXT NULL,
`Description_Lang_deDE` TEXT NULL,
`Description_Lang_enCN` TEXT NULL,
`Description_Lang_zhCN` TEXT NULL,
`Description_Lang_enTW` TEXT NULL,
`Description_Lang_zhTW` TEXT NULL,
`Description_Lang_esES` TEXT NULL,
`Description_Lang_esMX` TEXT NULL,
`Description_Lang_ruRU` TEXT NULL,
`Description_Lang_ptPT` TEXT NULL,
`Description_Lang_ptBR` TEXT NULL,
`Description_Lang_itIT` TEXT NULL,
`Description_Lang_Unk` TEXT NULL,
`Description_Lang_Mask` INT UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+9 -3
View File
@@ -847,9 +847,15 @@ CharStartOutfitEntry const* GetCharStartOutfitEntry(uint8 race, uint8 class_, ui
/// Returns LFGDungeonEntry for a specific map and difficulty. Will return first found entry if multiple dungeons use the same map (such as Scarlet Monastery) /// Returns LFGDungeonEntry for a specific map and difficulty. Will return first found entry if multiple dungeons use the same map (such as Scarlet Monastery)
LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty) LFGDungeonEntry const* GetLFGDungeon(uint32 mapId, Difficulty difficulty)
{ {
for (LFGDungeonEntry const* dungeon : sLFGDungeonStore) for (uint32 i = 0; i < sLFGDungeonStore.GetNumRows(); ++i)
if (dungeon->map == int32(mapId) && Difficulty(dungeon->difficulty) == difficulty) {
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(i);
if (!dungeon)
continue;
if (dungeon->MapID == uint32(mapId) && Difficulty(dungeon->Difficulty) == difficulty)
return dungeon; return dungeon;
}
return nullptr; return nullptr;
} }
@@ -858,7 +864,7 @@ LFGDungeonEntry const* GetZoneLFGDungeonEntry(std::string const& zoneName, Local
{ {
for (LFGDungeonEntry const* dungeon : sLFGDungeonStore) for (LFGDungeonEntry const* dungeon : sLFGDungeonStore)
{ {
if (dungeon->type == lfg::LFG_TYPE_ZONE && zoneName.find(dungeon->name[locale]) != std::string::npos) if (dungeon->TypeID == lfg::LFG_TYPE_ZONE && zoneName.find(dungeon->Name[locale]) != std::string::npos)
{ {
return dungeon; return dungeon;
} }
+1 -1
View File
@@ -189,7 +189,7 @@ namespace lfg
if (!dungeon) if (!dungeon)
continue; continue;
switch (dungeon->type) switch (dungeon->TypeID)
{ {
case LFG_TYPE_DUNGEON: case LFG_TYPE_DUNGEON:
case LFG_TYPE_HEROIC: case LFG_TYPE_HEROIC:
+4 -4
View File
@@ -394,10 +394,10 @@ namespace lfg
{ {
LFGDungeonData(): name("") LFGDungeonData(): name("")
{ } { }
LFGDungeonData(LFGDungeonEntry const* dbc): id(dbc->ID), name(dbc->name[0]), map(dbc->map), LFGDungeonData(LFGDungeonEntry const* dbc) : id(dbc->ID), name(dbc->Name[0]), map(dbc->MapID),
type(dbc->type), expansion(dbc->expansion), group(dbc->grouptype), type(dbc->TypeID), expansion(uint8(dbc->ExpansionLevel)), group(uint8(dbc->GroupID)),
minlevel(dbc->minlevel), maxlevel(dbc->maxlevel), difficulty(Difficulty(dbc->difficulty)), minlevel(uint8(dbc->MinLevel)), maxlevel(uint8(dbc->MaxLevel)), difficulty(Difficulty(dbc->Difficulty)),
seasonal(dbc->flags & LFG_FLAG_SEASONAL), x(0.0f), y(0.0f), z(0.0f), o(0.0f) seasonal((dbc->Flags & LFG_FLAG_SEASONAL) != 0), x(0.0f), y(0.0f), z(0.0f), o(0.0f)
{ } { }
uint32 id{0}; uint32 id{0};
+1 -1
View File
@@ -445,7 +445,7 @@ namespace lfg
{ {
if (Player* player = ObjectAccessor::FindConnectedPlayer(itRoles->first)) if (Player* player = ObjectAccessor::FindConnectedPlayer(itRoles->first))
{ {
if (player->GetMapId() == static_cast<uint32>(dungeon->map)) if (player->GetMapId() == static_cast<uint32>(dungeon->MapID))
{ {
if (InstanceScript* instance = player->GetInstanceScript()) if (InstanceScript* instance = player->GetInstanceScript())
{ {
+1 -1
View File
@@ -5878,7 +5878,7 @@ void Player::RewardReputation(Unit* victim, float rate)
Map const* map = GetMap(); Map const* map = GetMap();
if (map->IsNonRaidDungeon()) if (map->IsNonRaidDungeon())
if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficulty())) if (LFGDungeonEntry const* dungeon = GetLFGDungeon(map->GetId(), map->GetDifficulty()))
if (dungeon->reclevel == 80) if (dungeon->TargetLevel == 80)
ChampioningFaction = GetChampioningFaction(); ChampioningFaction = GetChampioningFaction();
} }
@@ -2256,7 +2256,7 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptr<Charact
// Get level from LFGDungeonEntry because the one from AreaTableEntry is not valid // Get level from LFGDungeonEntry because the one from AreaTableEntry is not valid
// If area level is too big, do not add new taxi // If area level is too big, do not add new taxi
if (lfgDungeon->minlevel > level) if (lfgDungeon->MinLevel > level)
{ {
FillTaxiMask(field, 0); FillTaxiMask(field, 0);
continue; continue;
+20 -17
View File
@@ -1246,24 +1246,27 @@ struct ItemSetEntry
struct LFGDungeonEntry struct LFGDungeonEntry
{ {
uint32 ID; // 0 uint32 ID; // 0
char const* name[16]; // 1-17 Name lang char const* Name[16]; // 1-16
uint32 minlevel; // 18 //uint32 Name_lang_mask; // 17
uint32 maxlevel; // 19 uint32 MinLevel; // 18
uint32 reclevel; // 20 uint32 MaxLevel; // 19
uint32 recminlevel; // 21 uint32 TargetLevel; // 20
uint32 recmaxlevel; // 22 uint32 TargetLevelMin; // 21
int32 map; // 23 uint32 TargetLevelMax; // 22
uint32 difficulty; // 24 uint32 MapID; // 23
uint32 flags; // 25 uint32 Difficulty; // 24
uint32 type; // 26 uint32 Flags; // 25
//uint32 unk; // 27 uint32 TypeID; // 26
//char const* iconname; // 28 //int32 Faction; // 27
uint32 expansion; // 29 //char const* TextureFilename; // 28
//uint32 unk4; // 30 uint32 ExpansionLevel; // 29
uint32 grouptype; // 31 //uint32 OrderIndex; // 30
//char const* desc[16]; // 32-47 Description uint32 GroupID; // 31
//char const* Description[16]; // 32-47
//uint32 Description_lang_mask; // 48
// Helpers // Helpers
[[nodiscard]] uint32 Entry() const { return ID + (type << 24); } [[nodiscard]] uint32 Entry() const { return ID + (TypeID << 24); }
}; };
struct LightEntry struct LightEntry