mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
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:
@@ -7,6 +7,9 @@
|
|||||||
|
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
|
#include "ServerFacade.h"
|
||||||
|
#include "AoeValues.h"
|
||||||
|
#include "TargetValue.h"
|
||||||
|
|
||||||
NextAction** CastAbolishPoisonAction::getAlternatives()
|
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"); }
|
Value<Unit*>* CastHibernateCcAction::GetTargetValue() { return context->GetValue<Unit*>("cc target", "hibernate"); }
|
||||||
|
|
||||||
bool CastHibernateCcAction::Execute(Event event) { return botAI->CastSpell("hibernate", GetTarget()); }
|
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()
|
NextAction** CastReviveAction::getPrerequisites()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -144,6 +144,8 @@ class CastStarfallAction : public CastSpellAction
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CastStarfallAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "starfall") {}
|
CastStarfallAction(PlayerbotAI* botAI) : CastSpellAction(botAI, "starfall") {}
|
||||||
|
|
||||||
|
bool isUseful() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CastHurricaneAction : public CastSpellAction
|
class CastHurricaneAction : public CastSpellAction
|
||||||
|
|||||||
Reference in New Issue
Block a user