ThePenguinMan96 de9f8fbbea Druid Flight Form Bug Fix
Hello everyone,

This is a fix for issue #1233

I have added a clause in the CanCastSpell check that checks if the bot is in flight form/swift flight form & not in combat. It will no longer attempt to shift into a caster form  and repetitively try and heal/buff party members while flying. Tested on my PC with the changes and druid now successfully flies as fast as the player with no stopping.

This was causing the issue:

static ActionNode* thorns([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("thorns",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ nullptr,
                          /*C*/ nullptr);
}

static ActionNode* thorns_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("thorns on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ nullptr,
                          /*C*/ nullptr);
}

static ActionNode* mark_of_the_wild([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("mark of the wild",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ nullptr,
                          /*C*/ nullptr);
}

static ActionNode* mark_of_the_wild_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("mark of the wild on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ nullptr,
                          /*C*/ nullptr);
}
static ActionNode* regrowth_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("regrowth on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}
static ActionNode* rejuvenation_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("rejuvenation on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}
static ActionNode* remove_curse_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("remove curse on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}
static ActionNode* abolish_poison_on_party([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("abolish poison on party",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}
static ActionNode* revive([[maybe_unused]] PlayerbotAI* botAI)
{
    return new ActionNode("revive",
                          /*P*/ NextAction::array(0, new NextAction("caster form"), nullptr),
                          /*A*/ NULL,
                          /*C*/ NULL);
}

The *P* stands for prior, aka before this action is taken, do this other action "caster form". This is the Caster Form action:

class CastCasterFormAction : public CastBuffSpellAction
{
public:
    CastCasterFormAction(PlayerbotAI* botAI) : CastBuffSpellAction(botAI, "caster form") {}

    bool isUseful() override;
    bool isPossible() override { return true; }
    bool Execute(Event event) override;
};

And this:

bool CastCasterFormAction::isUseful()
{
    return botAI->HasAnyAuraOf(GetTarget(), "dire bear form", "bear form", "cat form", "travel form", "aquatic form",
                               "flight form", "swift flight form", "moonkin form", nullptr) &&
           AI_VALUE2(uint8, "mana", "self target") > sPlayerbotAIConfig->mediumHealth;
}

bool CastCasterFormAction::Execute(Event event)
{
    botAI->RemoveShapeshift();
    return true;
}

So basically, the druid was triggering to heal/buff the party, and before it could do that, it had to switch into "caster form" which executed RemoveShapeshift(). After it did that, mounting back up into flight form/swift flight form had the highest priority, so it would loop the triggers/actions.
2025-07-27 01:10:31 -07:00
2025-07-27 01:10:31 -07:00
2021-12-30 17:13:09 +01:00
2021-12-30 17:13:09 +01:00
2023-05-22 23:14:17 +08:00
2022-03-12 22:27:09 +01:00
2024-03-05 11:06:57 +08:00
2024-04-08 21:38:36 +08:00
2024-04-08 21:38:36 +08:00
2025-01-24 19:12:45 +01:00

English | 中文

Playerbots Icon

Playerbots Module

mod-playerbots is an AzerothCore module that adds player-like bots to a server. The project is based off IKE3's Playerbots. Features include:

  • Bots that utilize real player data, allowing players to interact with their other characters, form parties, level up, and more;
  • Random bots that wander through the world and behave like players, simulating the MMO experience;
  • Bots capable of running raids and battlegrounds;
  • Highly configurable settings to define how bots behave;
  • Excellent performance, even when running thousands of bots.

This project is still under development. If you encounter any errors or experience crashes, we kindly request that you report them as GitHub issues. Your valuable feedback will help us improve this project collaboratively.

Playerbots Module has a Discord server where you can discuss the project.

Installation

Classic Installation

mod-playerbots requires a custom branch of AzerothCore to work: liyunfan1223/azerothcore-wotlk/tree/Playerbot. To install the module, simply run:

git clone https://github.com/liyunfan1223/azerothcore-wotlk.git --branch=Playerbot
cd azerothcore-wotlk/modules
git clone https://github.com/liyunfan1223/mod-playerbots.git --branch=master

For more information, refer to the AzerothCore Installation Guide and Installing a Module pages.

Docker Installation

Docker installation is considered experimental. To install the module on a Docker installation, run:

git clone https://github.com/liyunfan1223/azerothcore-wotlk.git --branch=Playerbot
cd azerothcore-wotlk/modules
git clone https://github.com/liyunfan1223/mod-playerbots.git --branch=master

Afterwards, create a docker-compose.override.yml file in the azerothcore-wotlk directory. This override file allows for mounting the modules directory to the ac-worldserver service which is required for it to run. Put the following inside and save:

services:
  ac-worldserver:
    volumes:
      - ./modules:/azerothcore/modules:ro

Additionally, this override file can be used to set custom configuration settings for ac-worldserver and any modules you install as environment variables:

services:
  ac-worldserver:
    environment:
      AC_RATE_XP_KILL: "1"
      AC_AI_PLAYERBOT_RANDOM_BOT_AUTOLOGIN: "1"
    volumes:
      - ./modules:/azerothcore/modules:ro

For example, to double the experience gain rate per kill, take the setting Rate.XP.Kill = 1 from woldserver.conf, convert it to an environment variable, and change it to the desired setting in the override file to get AC_RATE_XP_KILL: "2". If you wanted to disable random bots from logging in automatically, take the AiPlayerbot.RandomBotAutologin = 1 setting from playerbots.conf and do the same to get AC_AI_PLAYERBOT_RANDOM_BOT_AUTOLOGIN: "0". For more information on how to configure Azerothcore, Playerbots, and other module settings as environment variables in Docker Compose, see the "Configuring AzerothCore in Containers" section in the Install With Docker guide.

Before building, consider setting the database password. One way to do this is to create a .env file in the root azerothcore-wotlk directory using the template. This file also allows you to set the user and group Docker uses for the services in case you run into any permissions issues, which are the most common cause for Docker installation problems.

Use docker compose up -d --build to build and run the server. For more information, including how to create an account and taking backups, refer to the Install With Docker page.

Documentation

The Playerbots Wiki contains an extensive overview of addons, commands, and recommended configurations. Please note that documentation may be incomplete or out-of-date in some sections. Contributions are welcome.

Frequently Asked Questions

  • Why aren't my bots casting spells? Please make sure that the necessary English DBC file (enUS) is present.
  • What platforms are supported? We support Ubuntu, Windows, and macOS. Other Linux distros may work, but will not receive support.
  • Why isn't my source compiling? Please check the build status of our CI. If the latest build is failing, rever to the last successful commit until we address the issue.

Addons

Typically, bots are controlled via chat commands. For larger bot groups, this can be unwieldy. As an alternative, community members have developed client Add-Ons to allow controlling bots through the in-game UI. We recommend you check out their projects:

Acknowledgements

mod-playerbots is is based off ZhengPeiRu21/mod-playerbots and celguar/mangosbot-bots. We extend our gratitude to @ZhengPeiRu21 and @celguar for the continued efforts in maintaining the module.

Also, a thank you to the many contributors who've helped build this project:

Description
No description provided
Readme AGPL-3.0 53 MiB
Languages
C++ 99.7%
Python 0.2%