Enable new rpg strategy by default (#1192)

* Add RandomBotMinLevelChance

* Save mana only for healer

* Disable addclass dk for low level player

* Target selection and debuff cast with less players in group

* Change default rpg strategy and bots count in config

* Logs clean up

* Improve init=auto

* Remove login logs after initialization

* Rndbots stats for quest

* Prediction chase in reach combat

* Poor & Normal items ensurence for init=auto
This commit is contained in:
Yunfan Li
2025-04-11 20:31:38 +08:00
committed by GitHub
parent 0d19f298da
commit 19447c3914
18 changed files with 175 additions and 73 deletions

View File

@@ -135,11 +135,11 @@ protected:
float targetExpectedLifeTime;
};
// non caster
class NonCasterFindTargetSmartStrategy : public FindTargetStrategy
// General
class GeneralFindTargetSmartStrategy : public FindTargetStrategy
{
public:
NonCasterFindTargetSmartStrategy(PlayerbotAI* botAI, float dps)
GeneralFindTargetSmartStrategy(PlayerbotAI* botAI, float dps)
: FindTargetStrategy(botAI), dps_(dps), targetExpectedLifeTime(1000000)
{
}
@@ -178,7 +178,6 @@ public:
{
float new_time = new_unit->GetHealth() / dps_;
float old_time = old_unit->GetHealth() / dps_;
// [5-20] > (5-0] > (20-inf)
int new_level = GetIntervalLevel(new_unit);
int old_level = GetIntervalLevel(old_unit);
if (new_level != old_level)
@@ -297,20 +296,24 @@ Unit* DpsTargetValue::Calculate()
if (rti)
return rti;
// FindLeastHpTargetStrategy strategy(botAI);
Group* group = bot->GetGroup();
float dps = AI_VALUE(float, "estimated group dps");
if (group && botAI->IsCaster(bot))
if (botAI->GetNearGroupMemberCount() > 3)
{
CasterFindTargetSmartStrategy strategy(botAI, dps);
return TargetValue::FindTarget(&strategy);
if (botAI->IsCaster(bot))
{
// Caster find target strategy avoids casting spells on enemies
// with too low health to ensure the effectiveness of casting
CasterFindTargetSmartStrategy strategy(botAI, dps);
return TargetValue::FindTarget(&strategy);
}
else if (botAI->IsCombo(bot))
{
ComboFindTargetSmartStrategy strategy(botAI, dps);
return TargetValue::FindTarget(&strategy);
}
}
else if (botAI->IsCombo(bot))
{
ComboFindTargetSmartStrategy strategy(botAI, dps);
return TargetValue::FindTarget(&strategy);
}
NonCasterFindTargetSmartStrategy strategy(botAI, dps);
GeneralFindTargetSmartStrategy strategy(botAI, dps);
return TargetValue::FindTarget(&strategy);
}

View File

@@ -36,6 +36,10 @@ float EstimatedGroupDpsValue::Calculate()
if (member == bot) // calculated
continue;
// ignore real player as they may not help with damage
if (!GET_PLAYERBOT_AI(member) || GET_PLAYERBOT_AI(member)->IsRealPlayer())
continue;
if (!member || !member->IsInWorld() || !member->IsAlive())
continue;