mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-02-14 15:53:45 +00:00
Random bots gear related enhancements
This commit is contained in:
@@ -163,7 +163,8 @@ void AutoMaintenanceOnLevelupAction::AutoUpgradeEquip()
|
||||
PlayerbotFactory factory(bot, bot->GetLevel());
|
||||
if (!sPlayerbotAIConfig->equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig->equipmentPersistenceLevel)
|
||||
{
|
||||
factory.InitEquipment(true);
|
||||
if (sPlayerbotAIConfig->incrementalGearInit)
|
||||
factory.InitEquipment(true);
|
||||
}
|
||||
factory.InitAmmo();
|
||||
return;
|
||||
|
||||
@@ -187,7 +187,8 @@ void EquipAction::EquipItem(Item* item)
|
||||
// Priority 1: Replace main hand if the new weapon is strictly better
|
||||
// and if conditions allow (e.g. no conflicting 2H logic)
|
||||
bool betterThanMH = (newItemScore > mainHandScore);
|
||||
bool mhConditionOK = ((invType != INVTYPE_2HWEAPON && !have2HWeaponEquipped) ||
|
||||
// If a one-handed weapon is better, we can still use it instead of a two-handed weapon
|
||||
bool mhConditionOK = (invType != INVTYPE_2HWEAPON ||
|
||||
(isTwoHander && !canTitanGrip) ||
|
||||
(canTitanGrip && isValidTGWeapon));
|
||||
|
||||
|
||||
@@ -1801,7 +1801,6 @@ const Movement::PointsArray MovementAction::SearchForBestPath(float x, float y,
|
||||
|
||||
bool FleeAction::Execute(Event event)
|
||||
{
|
||||
// return Flee(AI_VALUE(Unit*, "current target"));
|
||||
return MoveAway(AI_VALUE(Unit*, "current target"), sPlayerbotAIConfig->fleeDistance, true);
|
||||
}
|
||||
|
||||
@@ -1811,6 +1810,10 @@ bool FleeAction::isUseful()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Unit* target = AI_VALUE(Unit*, "current target");
|
||||
if (target && target->IsInWorld() && !bot->IsWithinMeleeRange(target))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user