mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
[Avoid aoe] Tell avoiding timer
This commit is contained in:
@@ -1674,7 +1674,8 @@ bool AvoidAoeAction::FleePosition(Position pos, float radius, std::string name)
|
|||||||
}
|
}
|
||||||
if (farestDis > 0.0f) {
|
if (farestDis > 0.0f) {
|
||||||
if (MoveTo(bot->GetMapId(), bestPos.GetPositionX(), bestPos.GetPositionY(), bestPos.GetPositionZ(), false, false, true)) {
|
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;
|
std::ostringstream out;
|
||||||
out << "I'm avoiding " << name << "...";
|
out << "I'm avoiding " << name << "...";
|
||||||
bot->Say(out.str(), LANG_UNIVERSAL);
|
bot->Say(out.str(), LANG_UNIVERSAL);
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ class AvoidAoeAction : public MovementAction
|
|||||||
// Position PositionForMelee(Position pos, float radius);
|
// Position PositionForMelee(Position pos, float radius);
|
||||||
// Position PositionForRanged(Position pos, float radius);
|
// Position PositionForRanged(Position pos, float radius);
|
||||||
bool FleePosition(Position pos, float radius, std::string name);
|
bool FleePosition(Position pos, float radius, std::string name);
|
||||||
|
time_t lastTellTimer = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RunAwayAction : public MovementAction
|
class RunAwayAction : public MovementAction
|
||||||
|
|||||||
Reference in New Issue
Block a user