mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-23 05:26:22 +00:00
quest confirm accept(group quest)
This commit is contained in:
18
src/strategy/actions/QuestConfirmAcceptAction.cpp
Normal file
18
src/strategy/actions/QuestConfirmAcceptAction.cpp
Normal 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;
|
||||
}
|
||||
25
src/strategy/actions/QuestConfirmAcceptAction.h
Normal file
25
src/strategy/actions/QuestConfirmAcceptAction.h
Normal 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
|
||||
Reference in New Issue
Block a user