mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Allow bots to manage their own quest log and removed quests based on conditions
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
#include "NonCombatActions.h"
|
#include "NonCombatActions.h"
|
||||||
#include "OutfitAction.h"
|
#include "OutfitAction.h"
|
||||||
#include "PositionAction.h"
|
#include "PositionAction.h"
|
||||||
|
#include "DropQuestAction.h"
|
||||||
#include "RandomBotUpdateAction.h"
|
#include "RandomBotUpdateAction.h"
|
||||||
#include "ReachTargetActions.h"
|
#include "ReachTargetActions.h"
|
||||||
#include "ReleaseSpiritAction.h"
|
#include "ReleaseSpiritAction.h"
|
||||||
@@ -180,6 +181,7 @@ class ActionContext : public NamedObjectContext<Action>
|
|||||||
creators["turn in petition"] = &ActionContext::turn_in_petition;
|
creators["turn in petition"] = &ActionContext::turn_in_petition;
|
||||||
creators["buy tabard"] = &ActionContext::buy_tabard;
|
creators["buy tabard"] = &ActionContext::buy_tabard;
|
||||||
creators["guild manage nearby"] = &ActionContext::guild_manage_nearby;
|
creators["guild manage nearby"] = &ActionContext::guild_manage_nearby;
|
||||||
|
creators["clean quest log"] = &ActionContext::clean_quest_log;
|
||||||
|
|
||||||
// BG Tactics
|
// BG Tactics
|
||||||
creators["bg tactics"] = &ActionContext::bg_tactics;
|
creators["bg tactics"] = &ActionContext::bg_tactics;
|
||||||
@@ -351,6 +353,7 @@ class ActionContext : public NamedObjectContext<Action>
|
|||||||
static Action* turn_in_petition(PlayerbotAI* botAI) { return new PetitionTurnInAction(botAI); }
|
static Action* turn_in_petition(PlayerbotAI* botAI) { return new PetitionTurnInAction(botAI); }
|
||||||
static Action* buy_tabard(PlayerbotAI* botAI) { return new BuyTabardAction(botAI); }
|
static Action* buy_tabard(PlayerbotAI* botAI) { return new BuyTabardAction(botAI); }
|
||||||
static Action* guild_manage_nearby(PlayerbotAI* botAI) { return new GuildManageNearbyAction(botAI); }
|
static Action* guild_manage_nearby(PlayerbotAI* botAI) { return new GuildManageNearbyAction(botAI); }
|
||||||
|
static Action* clean_quest_log(PlayerbotAI* botAI) { return new CleanQuestLogAction(botAI); }
|
||||||
|
|
||||||
// BG Tactics
|
// BG Tactics
|
||||||
static Action* bg_tactics(PlayerbotAI* botAI) { return new BGTactics(botAI); }
|
static Action* bg_tactics(PlayerbotAI* botAI) { return new BGTactics(botAI); }
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ bool CleanQuestLogAction::Execute(Event event)
|
|||||||
uint8 totalQuests = 0;
|
uint8 totalQuests = 0;
|
||||||
|
|
||||||
DropQuestType(totalQuests); //Count the total quests
|
DropQuestType(totalQuests); //Count the total quests
|
||||||
|
|
||||||
if (MAX_QUEST_LOG_SIZE - totalQuests > 6)
|
if (MAX_QUEST_LOG_SIZE - totalQuests > 6)
|
||||||
{
|
{
|
||||||
DropQuestType(totalQuests, MAX_QUEST_LOG_SIZE, true, true); //Drop failed quests
|
DropQuestType(totalQuests, MAX_QUEST_LOG_SIZE, true, true); //Drop failed quests
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
void NonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
void NonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
|
||||||
{
|
{
|
||||||
|
triggers.push_back(new TriggerNode("random", NextAction::array(0, new NextAction("clean quest log", 1.0f), nullptr)));
|
||||||
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("check mount state", 1.0f),
|
triggers.push_back(new TriggerNode("timer", NextAction::array(0, new NextAction("check mount state", 1.0f),
|
||||||
// new NextAction("check values", 1.0f),
|
// new NextAction("check values", 1.0f),
|
||||||
nullptr)));
|
nullptr)));
|
||||||
|
|||||||
Reference in New Issue
Block a user