fix(Core/LFG): Lock Deathknights from the dungeonfinder until they complete their starting zone (#22270)

This commit is contained in:
Tereneckla
2025-06-05 14:43:35 +00:00
committed by GitHub
parent 2a93e7d410
commit fe2d1150b3
4 changed files with 44 additions and 9 deletions

View File

@@ -0,0 +1,2 @@
--
UPDATE `creature_template` SET `ScriptName` = 'npc_king_varian_wrynn' WHERE (`entry` = 29611);

View File

@@ -422,6 +422,8 @@ namespace lfg
lockData = LFG_LOCKSTATUS_TOO_HIGH_LEVEL; lockData = LFG_LOCKSTATUS_TOO_HIGH_LEVEL;
else if (dungeon->seasonal && !IsSeasonActive(dungeon->id)) else if (dungeon->seasonal && !IsSeasonActive(dungeon->id))
lockData = LFG_LOCKSTATUS_NOT_IN_SEASON; lockData = LFG_LOCKSTATUS_NOT_IN_SEASON;
else if (player->IsClass(CLASS_DEATH_KNIGHT) && !player->IsGameMaster() &&!(player->IsQuestRewarded(13188) || player->IsQuestRewarded(13189)))
lockData = LFG_LOCKSTATUS_QUEST_NOT_COMPLETED;
else if (ar) else if (ar)
{ {
// Check required items // Check required items

View File

@@ -472,10 +472,32 @@ public:
} }
}; };
enum KingVarianWrynn : uint32
{
// Deathknight Starting Zone End
QUEST_WHERE_KINGS_WALK = 13188,
};
class npc_king_varian_wrynn : public CreatureScript
{
public:
npc_king_varian_wrynn() : CreatureScript("npc_king_varian_wrynn") { }
bool OnQuestReward(Player* player, Creature* /*creature*/, Quest const* quest, uint32 /*item*/) override
{
if (quest->GetQuestId() == QUEST_WHERE_KINGS_WALK)
sLFGMgr->InitializeLockedDungeons(player);
return true;
}
};
void AddSC_stormwind_city() void AddSC_stormwind_city()
{ {
new npc_tyrion(); new npc_tyrion();
new npc_tyrion_spybot(); new npc_tyrion_spybot();
new npc_lord_gregor_lescovar(); new npc_lord_gregor_lescovar();
new npc_marzon_silent_blade(); new npc_marzon_silent_blade();
new npc_king_varian_wrynn();
} }

View File

@@ -33,6 +33,7 @@ EndContentData */
#include "ScriptedCreature.h" #include "ScriptedCreature.h"
#include "ScriptedGossip.h" #include "ScriptedGossip.h"
#include "TaskScheduler.h" #include "TaskScheduler.h"
#include "LFGMgr.h"
/*###### /*######
## npc_shenthul ## npc_shenthul
@@ -155,6 +156,9 @@ enum ThrallWarchief : uint32
QUEST_WHAT_THE_WIND_CARRIES = 6566, QUEST_WHAT_THE_WIND_CARRIES = 6566,
GOSSIP_MENU_THRALL = 3664, GOSSIP_MENU_THRALL = 3664,
GOSSIP_RESPONSE_THRALL_FIRST = 5733, GOSSIP_RESPONSE_THRALL_FIRST = 5733,
// Deathknight Starting Zone End
QUEST_WARCHIEFS_BLESSING = 13189,
}; };
const Position heraldOfThrallPos = { -462.404f, -2637.68f, 96.0656f, 5.8606f }; const Position heraldOfThrallPos = { -462.404f, -2637.68f, 96.0656f, 5.8606f };
@@ -204,14 +208,19 @@ public:
return true; return true;
} }
bool OnQuestReward(Player* /*player*/, Creature* creature, Quest const* quest, uint32 /*item*/) override bool OnQuestReward(Player* player, Creature* creature, Quest const* quest, uint32 /*item*/) override
{ {
if (quest->GetQuestId() == QUEST_FOR_THE_HORDE) switch (quest->GetQuestId())
{ {
case (QUEST_FOR_THE_HORDE):
if (creature && creature->AI()) if (creature && creature->AI())
{
creature->AI()->DoAction(ACTION_START_TALKING); creature->AI()->DoAction(ACTION_START_TALKING);
} break;
case (QUEST_WARCHIEFS_BLESSING):
sLFGMgr->InitializeLockedDungeons(player);
break;
default:
break;
} }
return true; return true;