mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
fix(Core/LFG): Lock Deathknights from the dungeonfinder until they complete their starting zone (#22270)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
--
|
||||
UPDATE `creature_template` SET `ScriptName` = 'npc_king_varian_wrynn' WHERE (`entry` = 29611);
|
||||
@@ -422,6 +422,8 @@ namespace lfg
|
||||
lockData = LFG_LOCKSTATUS_TOO_HIGH_LEVEL;
|
||||
else if (dungeon->seasonal && !IsSeasonActive(dungeon->id))
|
||||
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)
|
||||
{
|
||||
// Check required items
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
new npc_tyrion();
|
||||
new npc_tyrion_spybot();
|
||||
new npc_lord_gregor_lescovar();
|
||||
new npc_marzon_silent_blade();
|
||||
new npc_king_varian_wrynn();
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ EndContentData */
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "TaskScheduler.h"
|
||||
#include "LFGMgr.h"
|
||||
|
||||
/*######
|
||||
## npc_shenthul
|
||||
@@ -155,6 +156,9 @@ enum ThrallWarchief : uint32
|
||||
QUEST_WHAT_THE_WIND_CARRIES = 6566,
|
||||
GOSSIP_MENU_THRALL = 3664,
|
||||
GOSSIP_RESPONSE_THRALL_FIRST = 5733,
|
||||
|
||||
// Deathknight Starting Zone End
|
||||
QUEST_WARCHIEFS_BLESSING = 13189,
|
||||
};
|
||||
|
||||
const Position heraldOfThrallPos = { -462.404f, -2637.68f, 96.0656f, 5.8606f };
|
||||
@@ -204,14 +208,19 @@ public:
|
||||
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())
|
||||
{
|
||||
creature->AI()->DoAction(ACTION_START_TALKING);
|
||||
}
|
||||
break;
|
||||
case (QUEST_WARCHIEFS_BLESSING):
|
||||
sLFGMgr->InitializeLockedDungeons(player);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user