quest confirm accept(group quest)

This commit is contained in:
Yunfan Li
2023-11-01 23:23:01 +08:00
parent af44b22ce1
commit 5c579ecf17
5 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
#include "QuestConfirmAcceptAction.h"
#include "WorldPacket.h"
bool QuestConfirmAcceptAction::Execute(Event event)
{
WorldPacket packet(event.getPacket());
uint32 questId;
packet >> questId;
WorldPacket sendPacket(CMSG_QUEST_CONFIRM_ACCEPT);
sendPacket << questId;
Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
if (!quest || !bot->CanAddQuest(quest, true)) {
return false;
}
bot->GetSession()->HandleQuestConfirmAccept(sendPacket);
return true;
}

View File

@@ -0,0 +1,25 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version.
*/
#ifndef _PLAYERBOT_QUESTCONFIRMACCEPTACTION_H
#define _PLAYERBOT_QUESTCONFIRMACCEPTACTION_H
#include "PlayerbotAI.h"
#include "QuestAction.h"
#include "Player.h"
class ObjectGuid;
class Quest;
class Player;
class PlayerbotAI;
class WorldObject;
class QuestConfirmAcceptAction : public QuestAction
{
public:
QuestConfirmAcceptAction(PlayerbotAI* botAI) : QuestAction(botAI, "quest confirm accept") {}
bool Execute(Event event) override;
};
#endif