Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
!.gitignore

.cache/
build/

#
#Generic
#
Expand Down
11 changes: 11 additions & 0 deletions conf/playerbots.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,17 @@ AiPlayerbot.EnableRandomBotTrading = 1
# Configure message prefixes which will be excluded in analysis in trade action to open trade window
AiPlayerbot.TradeActionExcludedPrefixes = "RPLL_H_,DBMv4,{звезда} Questie,{rt1} Questie"

# This option will prevent ALL random bots from being randomized.
# It does not prevent periodic teleport.
# Without it, random bots will be periodically randomized unless they are in a guild
# with at least one character who is not a random bot.
AiPlayerbot.DisableRandomBotPeriodicRandomization = 1

# This option will prevent ALL random bots from being periodically teleported.
# THIS SHOULD NOT BE ENABLED AT ALL TIMES. It exists mostly for debugging purposes.
# Disabling periodic teleport will make the bots almost unable to reach new areas.
AiPlayerbot.DisableRandomBotPeriodicTeleportation = 0

#
#
#
Expand Down
1 change: 1 addition & 0 deletions src/Ai/Base/Actions/SayAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static const std::unordered_set<std::string> noReplyMsgs = {
"guard",
"do accept invitation",
"stats",
"manage_inventory",
"react ?",
"reset strats",
"home",
Expand Down
7 changes: 7 additions & 0 deletions src/Ai/Base/ChatActionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "LootStrategyAction.h"
#include "LootRollAction.h"
#include "MailAction.h"
#include "ManageInventoryAction.h"
#include "NamedObjectContext.h"
#include "NewRpgAction.h"
#include "PassLeadershipToMasterAction.h"
Expand Down Expand Up @@ -96,6 +97,9 @@ class ChatActionContext : public NamedObjectContext<Action>
creators["unlock traded item"] = &ChatActionContext::unlock_traded_item;
creators["range"] = &ChatActionContext::range;
creators["stats"] = &ChatActionContext::stats;

creators["manage inventory"] = &ChatActionContext::manage_inventory;

creators["quests"] = &ChatActionContext::quests;
creators["leave"] = &ChatActionContext::leave;
creators["reputation"] = &ChatActionContext::reputation;
Expand Down Expand Up @@ -280,6 +284,9 @@ class ChatActionContext : public NamedObjectContext<Action>
static Action* clean_quest_log(PlayerbotAI* botAI) { return new CleanQuestLogAction(botAI); }
static Action* share(PlayerbotAI* botAI) { return new ShareQuestAction(botAI); }
static Action* stats(PlayerbotAI* botAI) { return new StatsAction(botAI); }

static Action* manage_inventory(PlayerbotAI* botAI) { return new ManageInventoryAction(botAI); }

static Action* quests(PlayerbotAI* botAI) { return new ListQuestsAction(botAI); }
static Action* leave(PlayerbotAI* botAI) { return new LeaveGroupAction(botAI); }
static Action* reputation(PlayerbotAI* botAI) { return new TellReputationAction(botAI); }
Expand Down
2 changes: 2 additions & 0 deletions src/Ai/Base/ChatTriggerContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class ChatTriggerContext : public NamedObjectContext<Trigger>
creators["pet attack"] = &ChatTriggerContext::pet_attack;
creators["roll"] = &ChatTriggerContext::roll_action;
creators["wait for attack time"] = &ChatTriggerContext::wait_for_attack_time;
creators["manage inventory"] = &ChatTriggerContext::manage_inventory;
}

private:
Expand Down Expand Up @@ -271,6 +272,7 @@ class ChatTriggerContext : public NamedObjectContext<Trigger>
static Trigger* pet_attack(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "pet attack"); }
static Trigger* roll_action(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "roll"); }
static Trigger* wait_for_attack_time(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "wait for attack time"); }
static Trigger* manage_inventory(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "manage inventory"); }
};

#endif
10 changes: 10 additions & 0 deletions src/Ai/Base/Strategy/ChatCommandHandlerStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "PetsAction.h"
#include "PetAttackAction.h"
#include "LootRollAction.h"
#include "ManageInventoryAction.h"

class ChatCommandActionNodeFactoryInternal : public NamedObjectFactory<ActionNode>
{
Expand Down Expand Up @@ -469,6 +470,14 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector<TriggerNode*>& trigger
}
)
);
triggers.push_back(
new TriggerNode(
"manage inventory",
{
CreateNextAction<ManageInventoryAction>(relevance)
}
)
);
}

ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI)
Expand All @@ -478,6 +487,7 @@ ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : Pas
this->supported.push_back({ "tell pvp stats", CreateNextAction<TellPvpStatsAction>(relevance).factory });
this->supported.push_back({ "quests", CreateNextAction<ListQuestsAction>(relevance).factory });
this->supported.push_back({ "stats", CreateNextAction<StatsAction>(relevance).factory });
this->supported.push_back({ "manage inventory", CreateNextAction<ManageInventoryAction>(relevance).factory });
this->supported.push_back({ "leave", CreateNextAction<LeaveGroupAction>(relevance).factory });
this->supported.push_back({ "reputation", CreateNextAction<TellReputationAction>(relevance).factory });
this->supported.push_back({ "log", CreateNextAction<LogLevelAction>(relevance).factory });
Expand Down
9 changes: 9 additions & 0 deletions src/Ai/Base/Strategy/NonCombatStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "WorldBuffAction.h"
#include "FishingAction.h"
#include "EquipAction.h"
#include "ManageInventoryAction.h"

void NonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
Expand All @@ -22,6 +23,14 @@ void NonCombatStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
CreateNextAction<CleanQuestLogAction>(1.0f)
}
)
);
triggers.push_back(
new TriggerNode(
"seldom",
{
CreateNextAction<ManageInventoryAction>(1.0f)
}
)
);
triggers.push_back(
new TriggerNode(
Expand Down
Loading