Core/Scenarios: Use the LFG dungeon's scenario when no scenario is set for the map
This commit is contained in:
@@ -43,7 +43,15 @@ InstanceScenario* ScenarioMgr::CreateInstanceScenarioForTeam(InstanceMap* map, T
|
||||
auto dbDataItr = _scenarioDBData.find(std::make_pair(map->GetId(), map->GetDifficultyID()));
|
||||
// No scenario registered for this map and difficulty in the database
|
||||
if (dbDataItr == _scenarioDBData.end())
|
||||
{
|
||||
// Several dungeons can share a map and difficulty, each with its own scenario (Torghast wings and layers)
|
||||
if (Optional<uint32> lfgDungeonsId = map->GetLfgDungeonsId())
|
||||
if (LFGDungeonsEntry const* dungeon = sLFGDungeonsStore.LookupEntry(*lfgDungeonsId))
|
||||
if (dungeon->ScenarioID)
|
||||
return CreateInstanceScenario(map, dungeon->ScenarioID);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 scenarioID = 0;
|
||||
switch (team)
|
||||
|
||||
@@ -416,7 +416,31 @@ private:
|
||||
ObjectGuid _morlenGUID;
|
||||
};
|
||||
|
||||
// 1254519 - Mark Survivor (Wake of the Darkwell, quest 92520)
|
||||
// The click spell's only effect is a dummy. Marking a survivor counts as killing it for the player: its own entry,
|
||||
// its KillCredit entries and its creature labels (label 5590 "Other survivors recovered") give credit. The mages then
|
||||
// take the survivor away, so it leaves shortly after.
|
||||
class spell_isle_of_queldanas_mark_survivor : public SpellScript
|
||||
{
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Player* player = Object::ToPlayer(GetCaster());
|
||||
Creature* survivor = GetHitCreature();
|
||||
if (!player || !survivor)
|
||||
return;
|
||||
|
||||
player->KilledMonster(survivor);
|
||||
survivor->DespawnOrUnsummon(2s);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_isle_of_queldanas_mark_survivor::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_isle_of_queldanas()
|
||||
{
|
||||
RegisterCreatureAI(npc_thalorien_dawnseeker);
|
||||
RegisterSpellScript(spell_isle_of_queldanas_mark_survivor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user