Skip to content

Commit

Permalink
-Group fix: Bots can now leave groups even if they are constantly dead.
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikely4r committed May 17, 2023
1 parent 74d298c commit 2c129cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion playerbot/AiFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ Engine* AiFactory::createNonCombatEngine(Player* player, PlayerbotAI* const faca

void AiFactory::AddDefaultDeadStrategies(Player* player, PlayerbotAI* const facade, Engine* deadEngine)
{
deadEngine->addStrategies("dead", "stay", "default", "follow", NULL);
deadEngine->addStrategies("dead", "stay", "default", "follow", "group", NULL);
if (sRandomPlayerbotMgr.IsFreeBot(player) && !player->GetGroup())
{
deadEngine->removeStrategy("follow");
Expand Down
10 changes: 10 additions & 0 deletions playerbot/strategy/generic/GroupStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,13 @@ void GroupStrategy::InitNonCombatTriggers(std::list<TriggerNode*> &triggers)
NextAction::array(0, new NextAction("reset instances", 1.0f), NULL)));*/
}

void GroupStrategy::InitDeadTriggers(std::list<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode(
"seldom",
NextAction::array(0, new NextAction("leave far away", 4.0f), NULL)));

triggers.push_back(new TriggerNode(
"leader is afk",
NextAction::array(0, new NextAction("leave far away", 4.0f), NULL)));
}
1 change: 1 addition & 0 deletions playerbot/strategy/generic/GroupStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ namespace ai

private:
void InitNonCombatTriggers(std::list<TriggerNode*> &triggers) override;
void InitDeadTriggers(std::list<TriggerNode*>& triggers) override;
};
}

0 comments on commit 2c129cb

Please sign in to comment.