Core/Dungeon Finder: Implemented Luck of the Draw buff
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "MapManager.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Group.h"
|
||||
#include "LFGMgr.h"
|
||||
|
||||
union u_map_magic
|
||||
{
|
||||
@@ -2318,6 +2319,13 @@ bool InstanceMap::AddPlayerToMap(Player* player)
|
||||
ASSERT(playerBind->save == mapSave);
|
||||
}
|
||||
}
|
||||
|
||||
if (group && group->isLFGGroup())
|
||||
if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
|
||||
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
|
||||
if (LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin())))
|
||||
if (dungeon->map == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM)
|
||||
player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true);
|
||||
}
|
||||
|
||||
// for normal instances cancel the reset schedule when the
|
||||
|
||||
Reference in New Issue
Block a user