mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-12-01 21:12:50 +08:00
[MIscs] Equips, avoid aoe tell
This commit is contained in:
@@ -1431,11 +1431,14 @@ void PlayerbotFactory::InitEquipment(bool incremental)
|
|||||||
if (level < 40 && (slot == EQUIPMENT_SLOT_TRINKET1 || slot == EQUIPMENT_SLOT_TRINKET2))
|
if (level < 40 && (slot == EQUIPMENT_SLOT_TRINKET1 || slot == EQUIPMENT_SLOT_TRINKET2))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (level < 25 && slot == EQUIPMENT_SLOT_NECK)
|
if (level < 30 && slot == EQUIPMENT_SLOT_NECK)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (level < 25 && slot == EQUIPMENT_SLOT_HEAD)
|
if (level < 25 && slot == EQUIPMENT_SLOT_HEAD)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (level < 20 && (slot == EQUIPMENT_SLOT_FINGER1 || slot == EQUIPMENT_SLOT_FINGER2))
|
||||||
|
continue;
|
||||||
|
|
||||||
uint32 desiredQuality = itemQuality;
|
uint32 desiredQuality = itemQuality;
|
||||||
if (urand(0, 100) < 100 * sPlayerbotAIConfig->randomGearLoweringChance && desiredQuality > ITEM_QUALITY_NORMAL) {
|
if (urand(0, 100) < 100 * sPlayerbotAIConfig->randomGearLoweringChance && desiredQuality > ITEM_QUALITY_NORMAL) {
|
||||||
|
|||||||
@@ -1540,8 +1540,8 @@ bool AvoidAoeAction::AvoidAuraWithDynamicObj()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::ostringstream name;
|
std::ostringstream name;
|
||||||
name << "[" << spellInfo->SpellName[0] << "] (aura)";
|
name << spellInfo->SpellName[0]; // << "] (aura)";
|
||||||
if (FleePostion(dynOwner->GetPosition(), radius, name.str())) {
|
if (FleePosition(dynOwner->GetPosition(), radius, name.str())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -1591,8 +1591,8 @@ bool AvoidAoeAction::AvoidGameObjectWithDamage()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::ostringstream name;
|
std::ostringstream name;
|
||||||
name << "[" << spellInfo->SpellName[0] << "] (object)";
|
name << spellInfo->SpellName[0]; // << "] (object)";
|
||||||
if (FleePostion(go->GetPosition(), radius, name.str())) {
|
if (FleePosition(go->GetPosition(), radius, name.str())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1633,8 +1633,8 @@ bool AvoidAoeAction::AvoidUnitWithDamageAura()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
std::ostringstream name;
|
std::ostringstream name;
|
||||||
name << "[" << triggerSpellInfo->SpellName[0] << "] (unit)";
|
name << triggerSpellInfo->SpellName[0]; //<< "] (unit)";
|
||||||
if (FleePostion(unit->GetPosition(), radius, name.str())) {
|
if (FleePosition(unit->GetPosition(), radius, name.str())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1645,7 +1645,7 @@ bool AvoidAoeAction::AvoidUnitWithDamageAura()
|
|||||||
return false;
|
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");
|
Unit* currentTarget = AI_VALUE(Unit*, "current target");
|
||||||
std::vector<float> possibleAngles;
|
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 (MoveTo(bot->GetMapId(), bestPos.GetPositionX(), bestPos.GetPositionY(), bestPos.GetPositionZ(), false, false, true)) {
|
||||||
if (sPlayerbotAIConfig->tellWhenAvoidAoe) {
|
if (sPlayerbotAIConfig->tellWhenAvoidAoe) {
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << "Avoiding spell " << name << "...";
|
out << "I'm avoiding " << name << "...";
|
||||||
bot->Say(out.str(), LANG_UNIVERSAL);
|
bot->Say(out.str(), LANG_UNIVERSAL);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -78,7 +78,10 @@ class AvoidAoeAction : public MovementAction
|
|||||||
bool AvoidAuraWithDynamicObj();
|
bool AvoidAuraWithDynamicObj();
|
||||||
bool AvoidGameObjectWithDamage();
|
bool AvoidGameObjectWithDamage();
|
||||||
bool AvoidUnitWithDamageAura();
|
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
|
class RunAwayAction : public MovementAction
|
||||||
|
|||||||
Reference in New Issue
Block a user