[Spell] Healer spell enhancement

This commit is contained in:
Yunfan Li
2024-10-04 20:48:29 +08:00
parent db9b1115cb
commit 21e17e163b
15 changed files with 137 additions and 59 deletions

View File

@@ -47,4 +47,35 @@ bool CastRebirthAction::isUseful()
{
return CastSpellAction::isUseful() &&
AI_VALUE2(float, "distance", GetTargetName()) <= sPlayerbotAIConfig->spellDistance;
}
Unit* CastRejuvenationOnNotFullAction::GetTarget()
{
Group* group = bot->GetGroup();
MinValueCalculator calc(100);
for (GroupReference* gref = group->GetFirstMember(); gref; gref = gref->next())
{
Player* player = gref->GetSource();
if (!player)
continue;
if (player->isDead() || player->IsFullHealth())
{
continue;
}
if (player->GetDistance2d(bot) > sPlayerbotAIConfig->spellDistance)
{
continue;
}
if (botAI->HasAura("rejuvenation", player))
{
continue;
}
calc.probe(player->GetHealthPct(), player);
}
return (Unit*)calc.param;
}
bool CastRejuvenationOnNotFullAction::isUseful()
{
return GetTarget();
}

View File

@@ -311,4 +311,16 @@ public:
CastEnrageAction(PlayerbotAI* ai) : CastBuffSpellAction(ai, "enrage") {}
};
class CastRejuvenationOnNotFullAction : public HealPartyMemberAction
{
public:
CastRejuvenationOnNotFullAction(PlayerbotAI* ai)
: HealPartyMemberAction(ai, "rejuvenation", 5.0f, HealingManaEfficiency::VERY_HIGH)
{
}
bool isUseful() override;
Unit* GetTarget() override;
};
#endif

View File

@@ -209,6 +209,7 @@ public:
creators["healing touch"] = &DruidAiObjectContextInternal::healing_touch;
creators["regrowth on party"] = &DruidAiObjectContextInternal::regrowth_on_party;
creators["rejuvenation on party"] = &DruidAiObjectContextInternal::rejuvenation_on_party;
creators["rejuvenation on not full"] = &DruidAiObjectContextInternal::rejuvenation_on_not_full;
creators["healing touch on party"] = &DruidAiObjectContextInternal::healing_touch_on_party;
creators["rebirth"] = &DruidAiObjectContextInternal::rebirth;
creators["revive"] = &DruidAiObjectContextInternal::revive;
@@ -295,6 +296,7 @@ private:
static Action* healing_touch(PlayerbotAI* botAI) { return new CastHealingTouchAction(botAI); }
static Action* regrowth_on_party(PlayerbotAI* botAI) { return new CastRegrowthOnPartyAction(botAI); }
static Action* rejuvenation_on_party(PlayerbotAI* botAI) { return new CastRejuvenationOnPartyAction(botAI); }
static Action* rejuvenation_on_not_full(PlayerbotAI* botAI) { return new CastRejuvenationOnNotFullAction(botAI); }
static Action* healing_touch_on_party(PlayerbotAI* botAI) { return new CastHealingTouchOnPartyAction(botAI); }
static Action* rebirth(PlayerbotAI* botAI) { return new CastRebirthAction(botAI); }
static Action* revive(PlayerbotAI* botAI) { return new CastReviveAction(botAI); }

View File

@@ -164,9 +164,10 @@ void DruidAssistDpsStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
new NextAction("starfire", ACTION_DEFAULT),
nullptr)));
triggers.push_back(
new TriggerNode("medium aoe and healer should attack",
NextAction::array(0,
new NextAction("hurricane", ACTION_DEFAULT + 0.7f),
nullptr)));
// long cast time
// triggers.push_back(
// new TriggerNode("medium aoe and healer should attack",
// NextAction::array(0,
// new NextAction("hurricane", ACTION_DEFAULT + 0.7f),
// nullptr)));
}

View File

@@ -70,8 +70,8 @@ void HealDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
NextAction::array(0,
new NextAction("tree form", ACTION_CRITICAL_HEAL + 4.1f),
new NextAction("swiftmend on party", ACTION_CRITICAL_HEAL + 4),
new NextAction("wild growth on party", ACTION_CRITICAL_HEAL + 3),
new NextAction("regrowth on party", ACTION_CRITICAL_HEAL + 2),
new NextAction("regrowth on party", ACTION_CRITICAL_HEAL + 3),
new NextAction("wild growth on party", ACTION_CRITICAL_HEAL + 2),
new NextAction("nourish on party", ACTION_CRITICAL_HEAL + 1),
// new NextAction("healing touch on party", ACTION_CRITICAL_HEAL + 0),
nullptr)));
@@ -80,36 +80,46 @@ void HealDruidStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
new TriggerNode("party member critical health",
NextAction::array(0, new NextAction("nature's swiftness", ACTION_CRITICAL_HEAL + 4), nullptr)));
triggers.push_back(new TriggerNode(
"group heal setting",
NextAction::array(0,
new NextAction("tree form", ACTION_MEDIUM_HEAL + 2.3f),
new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 2.2f),
new NextAction("rejuvenation on not full", ACTION_MEDIUM_HEAL + 2.1f),
nullptr)));
triggers.push_back(
new TriggerNode("medium group heal occasion",
NextAction::array(0, new NextAction("tranquility", ACTION_CRITICAL_HEAL + 5), nullptr)));
new TriggerNode("medium group heal setting",
NextAction::array(0,
new NextAction("tree form", ACTION_CRITICAL_HEAL + 0.6f),
new NextAction("tranquility", ACTION_CRITICAL_HEAL + 0.5f), nullptr)));
// LOW
triggers.push_back(
new TriggerNode("party member low health",
NextAction::array(0, new NextAction("tree form", ACTION_MEDIUM_HEAL + 9.1f),
new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 9),
new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 8),
new NextAction("swiftmend on party", ACTION_MEDIUM_HEAL + 7),
new NextAction("nourish on party", ACTION_MEDIUM_HEAL + 6),
NextAction::array(0, new NextAction("tree form", ACTION_MEDIUM_HEAL + 1.5f),
new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 1.4f),
new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 1.3f),
new NextAction("swiftmend on party", ACTION_MEDIUM_HEAL + 1.2),
new NextAction("nourish on party", ACTION_MEDIUM_HEAL + 1.1f),
nullptr)));
// MEDIUM
triggers.push_back(
new TriggerNode("party member medium health",
NextAction::array(0,
new NextAction("tree form", ACTION_MEDIUM_HEAL + 4.1f),
new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 4),
new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 3),
new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 2),
new NextAction("nourish on party", ACTION_MEDIUM_HEAL + 1), nullptr)));
new NextAction("tree form", ACTION_MEDIUM_HEAL + 0.5f),
new NextAction("wild growth on party", ACTION_MEDIUM_HEAL + 0.4f),
new NextAction("rejuvenation on party", ACTION_MEDIUM_HEAL + 0.3f),
new NextAction("regrowth on party", ACTION_MEDIUM_HEAL + 0.2f),
new NextAction("nourish on party", ACTION_MEDIUM_HEAL + 0.1f), nullptr)));
// almost full
triggers.push_back(
new TriggerNode("party member almost full health",
NextAction::array(0, new NextAction("wild growth on party", ACTION_LIGHT_HEAL + 3),
new NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 2),
new NextAction("regrowth on party", ACTION_LIGHT_HEAL + 1), nullptr)));
NextAction::array(0, new NextAction("wild growth on party", ACTION_LIGHT_HEAL + 0.3f),
new NextAction("rejuvenation on party", ACTION_LIGHT_HEAL + 0.2f),
new NextAction("regrowth on party", ACTION_LIGHT_HEAL + 0.1f), nullptr)));
triggers.push_back(
new TriggerNode("medium mana", NextAction::array(0, new NextAction("innervate", ACTION_HIGH + 5), nullptr)));