fix(Core/DungeonFinder): Seasonal bosses are available only via Dunge… (#8056)

* fix(Core/DungeonFinder): Seasonal bosses are available only via Dungeon Finder tool.

Fixes #7889

* Update.

* Buildfix.

* Missing.
This commit is contained in:
UltraNix
2021-10-14 13:22:37 +02:00
committed by GitHub
parent 01d3747efd
commit b8345a2f98
8 changed files with 88 additions and 7 deletions

View File

@@ -16,6 +16,7 @@
*/
#include "CellImpl.h"
#include "GameObjectAI.h"
#include "GossipDef.h"
#include "GridNotifiers.h"
#include "Group.h"
@@ -987,7 +988,7 @@ public:
Map::PlayerList const& players = me->GetMap()->GetPlayers();
if (!players.isEmpty() && players.begin()->GetSource() && players.begin()->GetSource()->GetGroup())
sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), 285, me->FindMap());
sLFGMgr->FinishDungeon(players.begin()->GetSource()->GetGroup()->GetGUID(), lfg::LFG_DUNGEON_HEADLESS_HORSEMAN, me->FindMap());
}
void KilledUnit(Unit* /*who*/) override
@@ -1428,6 +1429,27 @@ public:
return true;
}
struct go_loosely_turned_soilAI : public GameObjectAI
{
go_loosely_turned_soilAI(GameObject* gameObject) : GameObjectAI(gameObject) { }
bool CanBeSeen(Player const* player) override
{
if (player->IsGameMaster())
{
return true;
}
Group const* group = player->GetGroup();
return group && sLFGMgr->GetDungeon(group->GetGUID()) == lfg::LFG_DUNGEON_HEADLESS_HORSEMAN;
}
};
GameObjectAI* GetAI(GameObject* go) const override
{
return new go_loosely_turned_soilAI(go);
}
};
void AddSC_event_hallows_end_scripts()