[Avoid aoe] Tell avoiding timer

This commit is contained in:
Yunfan Li
2024-06-24 10:43:17 +08:00
parent 38ff51c9ca
commit c63fd39b92
2 changed files with 3 additions and 1 deletions

View File

@@ -1674,7 +1674,8 @@ bool AvoidAoeAction::FleePosition(Position pos, float radius, std::string name)
}
if (farestDis > 0.0f) {
if (MoveTo(bot->GetMapId(), bestPos.GetPositionX(), bestPos.GetPositionY(), bestPos.GetPositionZ(), false, false, true)) {
if (sPlayerbotAIConfig->tellWhenAvoidAoe) {
if (sPlayerbotAIConfig->tellWhenAvoidAoe && lastTellTimer < time(NULL) - 10) {
lastTellTimer = time(NULL);
std::ostringstream out;
out << "I'm avoiding " << name << "...";
bot->Say(out.str(), LANG_UNIVERSAL);

View File

@@ -82,6 +82,7 @@ class AvoidAoeAction : public MovementAction
// Position PositionForMelee(Position pos, float radius);
// Position PositionForRanged(Position pos, float radius);
bool FleePosition(Position pos, float radius, std::string name);
time_t lastTellTimer = 0;
};
class RunAwayAction : public MovementAction