Skip to content

Commit

Permalink
[Avoid aoe] Tell when avoid aoe configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
liyunfan1223 committed Apr 20, 2024
1 parent 45ffd4b commit c6f1da1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions conf/playerbots.conf.dist
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ AiPlayerbot.SaveManaThreshold = 60
# Default: 0 (disable)
AiPlayerbot.AutoAvoidAoe = 0

# Tell which spell is avoiding (experimental)
# Default: 1 (enable)
AiPlayerbot.TellWhenAvoidAoe = 1

# Random bot default strategies (applied after defaults)
AiPlayerbot.RandomBotCombatStrategies = "+dps,+dps assist,-threat"
# AiPlayerbot.RandomBotNonCombatStrategies = "+grind,+loot,+rpg,+custom::say"
Expand Down
1 change: 1 addition & 0 deletions src/PlayerbotAIConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ bool PlayerbotAIConfig::Initialize()
autoSaveMana = sConfigMgr->GetOption<bool>("AiPlayerbot.AutoSaveMana", true);
saveManaThreshold = sConfigMgr->GetOption<int32>("AiPlayerbot.SaveManaThreshold", 60);
autoAvoidAoe = sConfigMgr->GetOption<bool>("AiPlayerbot.AutoAvoidAoe", false);
tellWhenAvoidAoe = sConfigMgr->GetOption<bool>("AiPlayerbot.TellWhenAvoidAoe", true);

randomGearLoweringChance = sConfigMgr->GetOption<float>("AiPlayerbot.RandomGearLoweringChance", 0.15f);
randomBotMaxLevelChance = sConfigMgr->GetOption<float>("AiPlayerbot.RandomBotMaxLevelChance", 0.15f);
Expand Down
1 change: 1 addition & 0 deletions src/PlayerbotAIConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class PlayerbotAIConfig
bool autoSaveMana;
uint32 saveManaThreshold;
bool autoAvoidAoe;
bool tellWhenAvoidAoe;

uint32 openGoSpell;
bool randomBotAutologin;
Expand Down
8 changes: 5 additions & 3 deletions src/strategy/actions/MovementActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1674,9 +1674,11 @@ bool AvoidAoeAction::FleePostion(Position pos, float radius, std::string name)
}
if (farestDis > 0.0f) {
if (MoveTo(bot->GetMapId(), bestPos.GetPositionX(), bestPos.GetPositionY(), bestPos.GetPositionZ(), false, false, true)) {
std::ostringstream out;
out << "Avoiding spell " << name << "...";
bot->Say(out.str(), LANG_UNIVERSAL);
if (sPlayerbotAIConfig->tellWhenAvoidAoe) {
std::ostringstream out;
out << "Avoiding spell " << name << "...";
bot->Say(out.str(), LANG_UNIVERSAL);
}
return true;
}
}
Expand Down

0 comments on commit c6f1da1

Please sign in to comment.