From 73be6fe119d7cb0993d4db3fc8b39dcb0bd7fd0c Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 23 Jun 2024 17:44:30 +0800 Subject: [PATCH] [MIscs] Equips, avoid aoe tell --- src/PlayerbotFactory.cpp | 5 ++++- src/strategy/actions/MovementActions.cpp | 16 ++++++++-------- src/strategy/actions/MovementActions.h | 5 ++++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 89782f68..b5fa94a0 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -1431,11 +1431,14 @@ void PlayerbotFactory::InitEquipment(bool incremental) if (level < 40 && (slot == EQUIPMENT_SLOT_TRINKET1 || slot == EQUIPMENT_SLOT_TRINKET2)) continue; - if (level < 25 && slot == EQUIPMENT_SLOT_NECK) + if (level < 30 && slot == EQUIPMENT_SLOT_NECK) continue; if (level < 25 && slot == EQUIPMENT_SLOT_HEAD) continue; + + if (level < 20 && (slot == EQUIPMENT_SLOT_FINGER1 || slot == EQUIPMENT_SLOT_FINGER2)) + continue; uint32 desiredQuality = itemQuality; if (urand(0, 100) < 100 * sPlayerbotAIConfig->randomGearLoweringChance && desiredQuality > ITEM_QUALITY_NORMAL) { diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index c0de3249..c5024d58 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -1540,8 +1540,8 @@ bool AvoidAoeAction::AvoidAuraWithDynamicObj() return false; } std::ostringstream name; - name << "[" << spellInfo->SpellName[0] << "] (aura)"; - if (FleePostion(dynOwner->GetPosition(), radius, name.str())) { + name << spellInfo->SpellName[0]; // << "] (aura)"; + if (FleePosition(dynOwner->GetPosition(), radius, name.str())) { return true; } return false; @@ -1591,8 +1591,8 @@ bool AvoidAoeAction::AvoidGameObjectWithDamage() continue; } std::ostringstream name; - name << "[" << spellInfo->SpellName[0] << "] (object)"; - if (FleePostion(go->GetPosition(), radius, name.str())) { + name << spellInfo->SpellName[0]; // << "] (object)"; + if (FleePosition(go->GetPosition(), radius, name.str())) { return true; } @@ -1633,8 +1633,8 @@ bool AvoidAoeAction::AvoidUnitWithDamageAura() break; } std::ostringstream name; - name << "[" << triggerSpellInfo->SpellName[0] << "] (unit)"; - if (FleePostion(unit->GetPosition(), radius, name.str())) { + name << triggerSpellInfo->SpellName[0]; //<< "] (unit)"; + if (FleePosition(unit->GetPosition(), radius, name.str())) { return true; } } @@ -1645,7 +1645,7 @@ bool AvoidAoeAction::AvoidUnitWithDamageAura() return false; } -bool AvoidAoeAction::FleePostion(Position pos, float radius, std::string name) +bool AvoidAoeAction::FleePosition(Position pos, float radius, std::string name) { Unit* currentTarget = AI_VALUE(Unit*, "current target"); std::vector possibleAngles; @@ -1676,7 +1676,7 @@ bool AvoidAoeAction::FleePostion(Position pos, float radius, std::string name) if (MoveTo(bot->GetMapId(), bestPos.GetPositionX(), bestPos.GetPositionY(), bestPos.GetPositionZ(), false, false, true)) { if (sPlayerbotAIConfig->tellWhenAvoidAoe) { std::ostringstream out; - out << "Avoiding spell " << name << "..."; + out << "I'm avoiding " << name << "..."; bot->Say(out.str(), LANG_UNIVERSAL); } return true; diff --git a/src/strategy/actions/MovementActions.h b/src/strategy/actions/MovementActions.h index befb1b43..1f6ee401 100644 --- a/src/strategy/actions/MovementActions.h +++ b/src/strategy/actions/MovementActions.h @@ -78,7 +78,10 @@ class AvoidAoeAction : public MovementAction bool AvoidAuraWithDynamicObj(); bool AvoidGameObjectWithDamage(); bool AvoidUnitWithDamageAura(); - bool FleePostion(Position pos, float radius, std::string name); + // Position PositionForTank(Position pos, float radius); + // Position PositionForMelee(Position pos, float radius); + // Position PositionForRanged(Position pos, float radius); + bool FleePosition(Position pos, float radius, std::string name); }; class RunAwayAction : public MovementAction