Balance-Druid-improve-Starfall-usage-and-add-CC-safety (#1713)

- Move Starfall from default actions to AOE strategy only
- Require 2+ enemies for Starfall usage (prevents single-target casting)
- Add CC safety: avoid casting Starfall near current CC targets
- Prioritize Starfall over Hurricane in medium AOE situations
- Remove Starfall from pull/opener rotation to prevent early
single-target usage

This prevents Balance druids from wasting Starfall on single targets
and breaking crowd control effects in group content.
This commit is contained in:
Gonzalo
2025-11-19 17:00:59 -03:00
committed by GitHub
parent 27311b734d
commit 8e03371147
2 changed files with 31 additions and 0 deletions

View File

@@ -7,6 +7,9 @@
#include "Event.h"
#include "Playerbots.h"
#include "ServerFacade.h"
#include "AoeValues.h"
#include "TargetValue.h"
NextAction** CastAbolishPoisonAction::getAlternatives()
{
@@ -30,6 +33,32 @@ bool CastEntanglingRootsCcAction::Execute(Event event) { return botAI->CastSpell
Value<Unit*>* CastHibernateCcAction::GetTargetValue() { return context->GetValue<Unit*>("cc target", "hibernate"); }
bool CastHibernateCcAction::Execute(Event event) { return botAI->CastSpell("hibernate", GetTarget()); }
bool CastStarfallAction::isUseful()
{
if (!CastSpellAction::isUseful())
return false;
// Avoid breaking CC
WorldLocation aoePos = *context->GetValue<WorldLocation>("aoe position");
Unit* ccTarget = context->GetValue<Unit*>("current cc target")->Get();
if (ccTarget && ccTarget->IsAlive())
{
float dist2d = sServerFacade->GetDistance2d(ccTarget, aoePos.GetPositionX(), aoePos.GetPositionY());
if (sServerFacade->IsDistanceLessOrEqualThan(dist2d, sPlayerbotAIConfig->aoeRadius))
return false;
}
// Avoid single-target usage on initial pull
uint8 aoeCount = *context->GetValue<uint8>("aoe count");
if (aoeCount < 2)
{
Unit* target = context->GetValue<Unit*>("current target")->Get();
if (!target || (!botAI->HasAura("moonfire", target) && !botAI->HasAura("insect swarm", target)))
return false;
}
return true;
}
NextAction** CastReviveAction::getPrerequisites()
{

View File

@@ -144,6 +144,8 @@ class CastStarfallAction : public CastSpellAction
{
public:
CastStarfallAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "starfall") {}
bool isUseful() override;
};
class CastHurricaneAction : public CastSpellAction