InitInstanceQuests

This commit is contained in:
Yunfan Li
2023-10-04 14:10:03 +08:00
parent e5a7f0448d
commit f0d1640865
2 changed files with 21 additions and 0 deletions

View File

@@ -149,6 +149,8 @@ void PlayerbotFactory::Randomize(bool incremental)
if (pmo) if (pmo)
pmo->finish(); pmo->finish();
*/ */
InitInstanceQuests();
bot->GiveLevel(level);
if (sPlayerbotAIConfig->randomBotPreQuests) if (sPlayerbotAIConfig->randomBotPreQuests)
{ {
@@ -2181,6 +2183,24 @@ void PlayerbotFactory::InitQuests(std::list<uint32>& questMap)
ClearInventory(); ClearInventory();
} }
void PlayerbotFactory::InitInstanceQuests()
{
// The Caverns of Time
if (bot->GetLevel() >= 64) {
uint32 questId = 10277;
Quest const *quest = sObjectMgr->GetQuestTemplate(questId);
bot->SetQuestStatus(questId, QUEST_STATUS_COMPLETE);
bot->RewardQuest(quest, 0, bot, false);
}
// Return to Andormu
if (bot->GetLevel() >= 66) {
uint32 questId = 10285;
Quest const *quest = sObjectMgr->GetQuestTemplate(questId);
bot->SetQuestStatus(questId, QUEST_STATUS_COMPLETE);
bot->RewardQuest(quest, 0, bot, false);
}
}
void PlayerbotFactory::ClearInventory() void PlayerbotFactory::ClearInventory()
{ {
DestroyItemsVisitor visitor(bot); DestroyItemsVisitor visitor(bot);

View File

@@ -138,6 +138,7 @@ class PlayerbotFactory : public InventoryAction
void InitTalents(uint32 specNo); void InitTalents(uint32 specNo);
void InitTalentsByTemplate(uint32 specNo); void InitTalentsByTemplate(uint32 specNo);
void InitQuests(std::list<uint32>& questMap); void InitQuests(std::list<uint32>& questMap);
void InitInstanceQuests();
void ClearInventory(); void ClearInventory();
void ClearAllItems(); void ClearAllItems();
void ResetQuests(); void ResetQuests();