Core/LFG: implement new DBC storage for generating multiple random categories with identical dungeon id's

* fixed another visual issue for call to arms rewards
This commit is contained in:
Ovahlord
2018-08-27 02:53:03 +02:00
parent 6c5947fe8b
commit 55deb00ce0
7 changed files with 41 additions and 20 deletions

View File

@@ -144,6 +144,7 @@ DBCStorage <ItemRandomSuffixEntry> sItemRandomSuffixStore(ItemRandomSuffixfmt);
DBCStorage <ItemSetEntry> sItemSetStore(ItemSetEntryfmt);
DBCStorage <LFGDungeonEntry> sLFGDungeonStore(LFGDungeonEntryfmt);
DBCStorage <LFGDungeonsGroupingMapEntry> sLFGDungeonsGroupingMapStore(LFGDungeonsGroupingMapfmt);
DBCStorage <LightEntry> sLightStore(LightEntryfmt);
DBCStorage <LiquidTypeEntry> sLiquidTypeStore(LiquidTypefmt);
DBCStorage <LockEntry> sLockStore(LockEntryfmt);
@@ -419,6 +420,7 @@ void LoadDBCStores(const std::string& dataPath)
LOAD_DBC(sItemDamageWandStore, "ItemDamageWand.dbc");//15595
LOAD_DBC(sItemDisenchantLootStore, "ItemDisenchantLoot.dbc");
LOAD_DBC(sLFGDungeonStore, "LFGDungeons.dbc");//15595
LOAD_DBC(sLFGDungeonsGroupingMapStore, "LFGDungeonsGroupingMap.dbc");//15595
LOAD_DBC(sLightStore, "Light.dbc"); //15595
LOAD_DBC(sLiquidTypeStore, "LiquidType.dbc");//15595
LOAD_DBC(sLockStore, "Lock.dbc");//15595

View File

@@ -174,6 +174,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 <LFGDungeonsGroupingMapEntry> sLFGDungeonsGroupingMapStore;
TC_GAME_API extern DBCStorage <LiquidTypeEntry> sLiquidTypeStore;
TC_GAME_API extern DBCStorage <LockEntry> sLockStore;
TC_GAME_API extern DBCStorage <MailTemplateEntry> sMailTemplateStore;

View File

@@ -1549,6 +1549,14 @@ struct LFGDungeonEntry
uint32 Entry() const { return ID + (type << 24); }
};
struct LFGDungeonsGroupingMapEntry
{
uint32 ID; // 0
uint32 dungeonId; // 1
uint32 randomLfgDungeonId; // 2
uint32 groupId; // 3
};
struct LightEntry
{
uint32 Id;

View File

@@ -102,6 +102,7 @@ char const ItemRandomPropertiesfmt[] = "nxiiixxs";
char const ItemRandomSuffixfmt[] = "nsxiiiiiiiiii";
char const ItemSetEntryfmt[] = "dsiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii";
char const LFGDungeonEntryfmt[] = "nsiiiiiiiiixxixixiiii";
char const LFGDungeonsGroupingMapfmt[] = "niii";
char const LightEntryfmt[] = "nifffxxxxxxxxxx";
char const LiquidTypefmt[] = "nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
char const LockEntryfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx";

View File

@@ -275,8 +275,11 @@ void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
dungeon.o = at->target_Orientation;
}
if (dungeon.type != LFG_TYPE_RANDOM)
if (dungeon.type == LFG_TYPE_RANDOM)
AddDungeonsFromGroupingMap(CachedDungeonMapStore, dungeon.group, dungeon.id);
else
CachedDungeonMapStore[dungeon.group].insert(dungeon.id);
CachedDungeonMapStore[0].insert(dungeon.id);
}
@@ -2177,4 +2180,17 @@ bool LFGDungeonData::IsRaid() const
return false;
}
void LFGMgr::AddDungeonsFromGroupingMap(LfgCachedDungeonContainer& container, uint32 groupId, uint32 dungeonId)
{
// Check for grouped dungeons from grouping map
for (auto itr : sLFGDungeonsGroupingMapStore)
{
if (itr->randomLfgDungeonId == dungeonId)
{
if (container[groupId].find(itr->dungeonId) == container[groupId].end())
container[groupId].insert(itr->dungeonId);
}
}
}
} // namespace lfg

View File

@@ -459,6 +459,7 @@ class TC_GAME_API LFGMgr
void RemovePlayerData(ObjectGuid guid);
void GetCompatibleDungeons(LfgDungeonSet& dungeons, GuidSet const& players, LfgLockPartyMap& lockMap, bool isContinue);
void _SaveToDB(ObjectGuid guid, uint32 db_guid);
void AddDungeonsFromGroupingMap(LfgCachedDungeonContainer& container, uint32 groupId, uint32 dungeonId);
// Proposals
void RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdateType type);

View File

@@ -412,31 +412,23 @@ void WorldSession::SendLfgPlayerLockInfo()
if (isCallToArmsEligible && ctaQuest)
{
uint8 callToArmsRoleMask = sLFGMgr->GetRolesForCallToArms();
bool rewardSent = false;
callToArmsRoleMask |= player->GetCallToArmsTempRoles();
uint8 roleSet[] =
{
lfg::PLAYER_ROLE_TANK,
lfg::PLAYER_ROLE_HEALER,
lfg::PLAYER_ROLE_DAMAGE
};
bool rewardSent = false;
for (uint8 i = 0; i < 3; i++)
{
data << uint32(callToArmsRoleMask);
if (callToArmsRoleMask & roleSet[i])
if (!rewardSent)
{
if (!rewardSent)
{
BuildQuestReward(data, ctaQuest, player);
rewardSent = true;
}
else
{
data << uint32(0);
data << uint32(0);
data << uint8(0);
}
rewardSent = true;
BuildQuestReward(data, ctaQuest, player);
}
else
{
data << uint32(0);
data << uint32(0);
data << uint8(0);
}
}
}