[MIscs] Equips, avoid aoe tell

This commit is contained in:
Yunfan Li
2024-06-23 17:44:30 +08:00
parent 51a88063f8
commit 73be6fe119
3 changed files with 16 additions and 10 deletions

View File

@@ -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) {

View File

@@ -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<float> 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;

View File

@@ -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